<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question CM API enable_nn_ha &amp;quot;Could not find NameNode&amp;quot; in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40368#M26852</link>
    <description>&lt;P&gt;I'm using the python CM API to try and enable HDFS HA on my cluster:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;hdfs_service&lt;/SPAN&gt;.enable_nn_ha(&lt;SPAN&gt;active_name&lt;/SPAN&gt;=hdfs_nn_host&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;nameservice&lt;/SPAN&gt;=&lt;SPAN&gt;"nameservice1"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;standby_host_id&lt;/SPAN&gt;=api.get_host(hdfs_snn_host).hostId&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;jns&lt;/SPAN&gt;=journal_nodes&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;zk_service_name&lt;/SPAN&gt;=ZOOKEEPER_SERVICE_NAME&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;force_init_znode&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;clear_existing_standby_name_dirs&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;clear_existing_jn_edits_dir&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;).wait()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This command leads to the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cm_api.api_client.ApiException: Could not find NameNode with name 'host1'&lt;/PRE&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;where host1 is the name of host running the NameNode service as shown by Cloudera Manager. &amp;nbsp;My question around the active_name parameter to this function is what actual value is the CM API looking for? &amp;nbsp;I've tried supplying the hostId value for this node as well, with no luck. &amp;nbsp;My HDFS service is up/running healthy as I am able to do all hdfs dfs * commands.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 10:16:37 GMT</pubDate>
    <dc:creator>TylerHale</dc:creator>
    <dc:date>2022-09-16T10:16:37Z</dc:date>
    <item>
      <title>CM API enable_nn_ha "Could not find NameNode"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40368#M26852</link>
      <description>&lt;P&gt;I'm using the python CM API to try and enable HDFS HA on my cluster:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;hdfs_service&lt;/SPAN&gt;.enable_nn_ha(&lt;SPAN&gt;active_name&lt;/SPAN&gt;=hdfs_nn_host&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;nameservice&lt;/SPAN&gt;=&lt;SPAN&gt;"nameservice1"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;standby_host_id&lt;/SPAN&gt;=api.get_host(hdfs_snn_host).hostId&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;jns&lt;/SPAN&gt;=journal_nodes&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;zk_service_name&lt;/SPAN&gt;=ZOOKEEPER_SERVICE_NAME&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;force_init_znode&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;   &lt;SPAN&gt;clear_existing_standby_name_dirs&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;clear_existing_jn_edits_dir&lt;/SPAN&gt;=&lt;SPAN&gt;True&lt;/SPAN&gt;).wait()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This command leads to the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cm_api.api_client.ApiException: Could not find NameNode with name 'host1'&lt;/PRE&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;where host1 is the name of host running the NameNode service as shown by Cloudera Manager. &amp;nbsp;My question around the active_name parameter to this function is what actual value is the CM API looking for? &amp;nbsp;I've tried supplying the hostId value for this node as well, with no luck. &amp;nbsp;My HDFS service is up/running healthy as I am able to do all hdfs dfs * commands.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:16:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40368#M26852</guid>
      <dc:creator>TylerHale</dc:creator>
      <dc:date>2022-09-16T10:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: CM API enable_nn_ha "Could not find NameNode"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40514#M26853</link>
      <description>&lt;P&gt;It's expecting the role/instance&amp;nbsp;name of your NN, you can retrieve that by&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example code using python&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;from&amp;nbsp;cm_api.api_client import&amp;nbsp;&lt;SPAN&gt;ApiResource&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;api = ApiResource(server_host="nightly57-1.gce.cloudera.com")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;#assuming your cluster name is 'Cluster 1' and hdfs service name is 'HDFS-1'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;NameNodes&amp;nbsp;=&amp;nbsp;api.get_cluster("Cluster 1").get_service("HDFS-1").get_roles_by_type("NAMENODE")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;print [&lt;SPAN&gt;instance&lt;/SPAN&gt;.name for&amp;nbsp;&lt;SPAN&gt;instance&lt;/SPAN&gt; in&amp;nbsp;&lt;SPAN&gt;NameNodes&lt;/SPAN&gt;]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;# sample stdout&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;[u'HDFS-1-NAMENODE-51999a2564364e0f3a6a74def356741b', u'HDFS-1-NAMENODE-46bf2f74734fa565bb829ef019ff4a2d']&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Alternatively, open your browser to http://cm_server:port/api/v6/clusters/{clusterName}/services/{HdfsServiceName}/roles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;"items" : [ {
    "name" : "&lt;STRONG&gt;HDFS-1-NAMENODE-51999a2564364e0f3a6a74def356741b&lt;/STRONG&gt;", &amp;lt;=== this
    "type" : "NAMENODE",&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;see:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v11/path__clusters_-clusterName-_services_-serviceName-_roles.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v11/path__clusters_-clusterName-_services_-serviceName-_roles.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 00:01:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40514#M26853</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2016-05-06T00:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: CM API enable_nn_ha "Could not find NameNode"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40530#M26854</link>
      <description>&lt;P&gt;Thanks - that worked!&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 12:07:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CM-API-enable-nn-ha-quot-Could-not-find-NameNode-quot/m-p/40530#M26854</guid>
      <dc:creator>TylerHale</dc:creator>
      <dc:date>2016-05-06T12:07:06Z</dc:date>
    </item>
  </channel>
</rss>

