<?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 Re: Unable to restrat standby Namenode in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160074#M122459</link>
    <description>&lt;P&gt;The only trick here is that if the failed namenode is offline (which it is, because, well, it's failed), the first 3 commands in the answer will fail because the hdfs shell can't talk to the failed namenode.  My workaround was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Edit /etc/hosts on the &lt;EM&gt;working &lt;/EM&gt;namenode to add the &lt;EM&gt;failed &lt;/EM&gt;namenode hostname on the &lt;EM&gt;same &lt;/EM&gt;line which defines the working node.  E.g., 

192.168.1.27  workingnode.domain.com workingnode

=&amp;gt;

192.168.27 workingnode.domain.com workingnode failednode.domain.com failednode

&lt;/LI&gt;&lt;LI&gt;Issue the first 3 commands listed in the answer.

&lt;/LI&gt;&lt;LI&gt;Undo the changes to /etc/hosts.

&lt;/LI&gt;&lt;LI&gt;Issue the 4th and 5th commands listed in the answer.

&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is there a better way?  Is there a way to force the working active namenode into safe mode even if the secondary is offline?&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2017 21:23:40 GMT</pubDate>
    <dc:creator>jarnold</dc:creator>
    <dc:date>2017-04-17T21:23:40Z</dc:date>
    <item>
      <title>Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160067#M122452</link>
      <description>&lt;P&gt;Both Namenode are crashed (Active &amp;amp; Standby). I restarted the Active and it is serving. But we are unable to restart the standby NN.  I tried to manually restart it but still it is failed.  How do I recover and restart the standby Namenode. &lt;/P&gt;&lt;P&gt;Version: HDP 2.2&lt;/P&gt;&lt;PRE&gt;2016-05-20 18:53:57,954 INFO namenode.EditLogInputStream (RedundantEditLogInputStream.java:nextOp(176)) - Fast-forwarding stream 'http://usw2stdpma01.glassdoor.local:8480/getJournal?jid=dfs-nameservices&amp;amp;segmentTxId=14726901&amp;amp;storageInfo=-60%3A761966699%3A0%3ACID-d16e0895-7c12-404e-9223-952d1b19ace0' to transaction ID 13013207
2016-05-20 18:53:58,216 WARN namenode.FSNamesystem (FSNamesystem.java:loadFromDisk(750)) - Encountered exception loading fsimage
java.io.IOException: There appears to be a gap in the edit log. We expected txid 13013207, but got txid 14726901.
at org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext.editLogLoaderPrompt(MetaRecoveryContext.java:94)
at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:212)
at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:140)
at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:829)
at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:684)
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:281)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1032)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:748)
at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:538)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:597)
at org.apache.hadoop.hdfs.server.namenode.NameNode.&amp;lt;init&amp;gt;(NameNode.java:764)
at org.apache.hadoop.hdfs.server.namenode.NameNode.&amp;lt;init&amp;gt;(NameNode.java:748)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1441)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1507)



2016-05-20 18:53:58,322 FATAL namenode.NameNode (NameNode.java:main(1512)) - Failed to start namenode.
java.io.IOException: There appears to be a gap in the edit log. We expected txid 13013207, but got txid 14726901.
at org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext.editLogLoaderPrompt(MetaRecoveryContext.java:94)
at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:212)
at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:140)
at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:829)
at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:684)
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:281)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1032)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:748)
at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:538)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:597)
at org.apache.hadoop.hdfs.server.namenode.NameNode.&amp;lt;init&amp;gt;(NameNode.java:764)
at org.apache.hadoop.hdfs.server.namenode.NameNode.&amp;lt;init&amp;gt;(NameNode.java:748)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1441)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1507)
2016-05-20 18:53:58,324 INFO util.ExitUtil (ExitUtil.java:terminate(124)) - Exiting with status 1
2016-05-20 18:53:58,325 INFO namenode.NameNode (StringUtils.java:run(659)) - SHUTDOWN_MSG&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 May 2016 06:22:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160067#M122452</guid>
      <dc:creator>anand_ranganath</dc:creator>
      <dc:date>2016-05-21T06:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160068#M122453</link>
      <description>&lt;P&gt;If this is a production cluster and you are on support, I suggest opening a support ticket since any tweaks can lead to data loss. &lt;/P&gt;&lt;P&gt;Before you more further, please take a back of NN metadata and edits from journal nodes. &lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2016 08:50:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160068#M122453</guid>
      <dc:creator>ravi1</dc:creator>
      <dc:date>2016-05-21T08:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160069#M122454</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/3560/anandranganathan.html"&gt;Anandha L Ranganathan&lt;/A&gt;&lt;/P&gt;&lt;P&gt;standby namenode and journal node configurations were in a corrupted state, so that when the cluster tried to switch to the standby, you encountered the error that you reported.&lt;/P&gt;&lt;P&gt;Initially we have toW put the primary namenode into safemode and saved the namespace with the following commands: &lt;/P&gt;&lt;P&gt;
hdfs dfsadmin -safemode enter 

hdfs dfsadmin -saveNamespace &lt;/P&gt;&lt;P&gt;su - hdfs -c "hdfs namenode -bootstrapStandby -force" &lt;/P&gt;&lt;P&gt;
this was to make sure that the namenode was in a consistent state before we attempted to restart the HDFS components one last time to make sure all processes started cleanly and that HDFS would automatically leave safemode&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2016 09:02:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160069#M122454</guid>
      <dc:creator>bandarusridhar1</dc:creator>
      <dc:date>2016-05-21T09:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160070#M122455</link>
      <description>&lt;P&gt;I have faced the same issue, used same steps to get standby namenode up and it worked. If you have any questions in following above steps please let me know. &lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2016 09:11:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160070#M122455</guid>
      <dc:creator>bandarusridhar1</dc:creator>
      <dc:date>2016-05-21T09:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160071#M122456</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/34636/unable-to-restrat-standby-namenode.html#"&gt;@Anandha L Ranganathan
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/34636/unable-to-restrat-standby-namenode.html#"&gt;Please run below commands by root user.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/34636/unable-to-restrat-standby-namenode.html#"&gt;1. Put Active NN in safemode&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;sudo -u hdfs hdfs dfsadmin -safemode enter&lt;/PRE&gt;&lt;P&gt;2. Do a savenamespace operation on Active NN&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/34636/unable-to-restrat-standby-namenode.html#"&gt;
&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;sudo -u hdfs hdfs dfsadmin -saveNamespace&lt;/PRE&gt;&lt;P&gt;3. Leave Safemode &lt;/P&gt;&lt;PRE&gt;sudo -u hdfs hdfs dfsadmin -safemode leave&lt;/PRE&gt;&lt;P&gt;4. Login to Standby NN&lt;/P&gt;&lt;P&gt;5. Run below command on &lt;STRONG&gt;Standby namenode&lt;/STRONG&gt; to get latest fsimage that we saved in above steps.&lt;/P&gt;&lt;PRE&gt;sudo -u hdfs hdfs namenode -bootstrapStandby -force&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 May 2016 02:18:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160071#M122456</guid>
      <dc:creator>KuldeepK</dc:creator>
      <dc:date>2016-05-22T02:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160072#M122457</link>
      <description>&lt;P&gt;Thanks It worked. It was on our dev cluster and got into problem while upgrading to HDP 2.4 due to some manual error. &lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 05:26:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160072#M122457</guid>
      <dc:creator>anand_ranganath</dc:creator>
      <dc:date>2016-05-24T05:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160073#M122458</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3560/anandranganathan.html" nodeid="3560"&gt;@Anandha L Ranganathan&lt;/A&gt; - Glad to hear that! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 05:32:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160073#M122458</guid>
      <dc:creator>KuldeepK</dc:creator>
      <dc:date>2016-05-24T05:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160074#M122459</link>
      <description>&lt;P&gt;The only trick here is that if the failed namenode is offline (which it is, because, well, it's failed), the first 3 commands in the answer will fail because the hdfs shell can't talk to the failed namenode.  My workaround was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Edit /etc/hosts on the &lt;EM&gt;working &lt;/EM&gt;namenode to add the &lt;EM&gt;failed &lt;/EM&gt;namenode hostname on the &lt;EM&gt;same &lt;/EM&gt;line which defines the working node.  E.g., 

192.168.1.27  workingnode.domain.com workingnode

=&amp;gt;

192.168.27 workingnode.domain.com workingnode failednode.domain.com failednode

&lt;/LI&gt;&lt;LI&gt;Issue the first 3 commands listed in the answer.

&lt;/LI&gt;&lt;LI&gt;Undo the changes to /etc/hosts.

&lt;/LI&gt;&lt;LI&gt;Issue the 4th and 5th commands listed in the answer.

&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is there a better way?  Is there a way to force the working active namenode into safe mode even if the secondary is offline?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 21:23:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160074#M122459</guid>
      <dc:creator>jarnold</dc:creator>
      <dc:date>2017-04-17T21:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160075#M122460</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/15534/jarnold.html" nodeid="15534"&gt;@Jeff Arnold&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I tried to start the failed &lt;STRONG&gt;namenode &lt;/STRONG&gt;on &lt;STRONG&gt;standbynamenode &lt;/STRONG&gt;with above steps. I faced some error on running these command&lt;STRONG&gt; "sudo -u hdfs hdfs namenode -bootstrapStandby -force"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x000000008c800000, 1937768448, 0) failed; error='Cannot allocate memory' (errno=12) &lt;/P&gt;&lt;P&gt;# &lt;/P&gt;&lt;P&gt;# There is insufficient memory for the Java Runtime Environment to continue. &lt;/P&gt;&lt;P&gt;# Native memory allocation (mmap) failed to map 1937768448 bytes for committing reserved memory. &lt;/P&gt;&lt;P&gt;# An error report file with more information is saved as:
# /var/log/hadoop/hdfs/hs_err_pid5144.log&lt;/P&gt;&lt;P&gt;Before executing the steps that you provided, I was facing these error while restarting &lt;STRONG&gt;namenode &lt;/STRONG&gt;on &lt;STRONG&gt;standbynamenode &lt;/STRONG&gt;via Ambari:&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 408, in &amp;lt;module&amp;gt;
    NameNode().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 103, in start
    upgrade_suspended=params.upgrade_suspended, env=env)
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py", line 118, in namenode
    raise Fail("Could not bootstrap standby namenode")
resource_management.core.exceptions.Fail: Could not bootstrap standby namenode&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Sep 2017 15:24:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160075#M122460</guid>
      <dc:creator>mahesh454347</dc:creator>
      <dc:date>2017-09-28T15:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160076#M122461</link>
      <description>&lt;P&gt;We just ran into this problem. @Jeff Arnold above is correct that since the standby namenode is down the dfsadmin commands will fail. Instead of the doing the /etc/hosts file change he recommends you can manually override the -fs in the commands suggested here &lt;A href="https://issues-test.apache.org/jira/browse/HDFS-8277?focusedCommentId=14517247&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14517247" target="_blank"&gt;https://issues-test.apache.org/jira/browse/HDFS-8277?focusedCommentId=14517247&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14517247&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;The dfsadmin commands change to this for example&lt;/P&gt;&lt;PRE&gt;sudo -u hdfs hdfs dfsadmin -fs hdfs://&amp;lt;active_namenode&amp;gt;:&amp;lt;rpc_port&amp;gt; -safemode enter&lt;/PRE&gt;&lt;P&gt;Also if you are using Cloudera Manager the config that gets used by "namenode -bootstrapStandby" command does not include the necessary config for the journal nodes for shared edits. You will need to copy the running config from the running active namenode. It will be under something like /run/cloudera-scm-agent/process/5134-hdfs-NAMENODE. Copy that to the standby namenode and set the bootstrap command to use it.&lt;/P&gt;&lt;PRE&gt;sudo -i -u hdfs
HADOOP_CONF_DIR=&amp;lt;your_copied_config&amp;gt; hdfs namenode -bootstrapStandby -force&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Jan 2018 04:42:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160076#M122461</guid>
      <dc:creator>srwilson</dc:creator>
      <dc:date>2018-01-27T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to restrat standby Namenode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160077#M122462</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/504/kkulkarni.html" nodeid="504"&gt;@Kuldeep Kulkarni&lt;/A&gt; it worked for us as well. &lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 13:01:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-restrat-standby-Namenode/m-p/160077#M122462</guid>
      <dc:creator>khanarshadazmat</dc:creator>
      <dc:date>2018-05-15T13:01:26Z</dc:date>
    </item>
  </channel>
</rss>

