<?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 how to verify if name node is in safe mode in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-verify-if-name-node-is-in-safe-mode/m-p/179646#M73070</link>
    <description>&lt;P&gt;how to verify if name node is in safe mode ?&lt;/P&gt;&lt;P&gt;goal - in case of name node in safe mode , then bash script will perform the following steps on one of the masters machines &lt;/P&gt;&lt;PRE&gt;# su - hdfs  
$ hdfs dfsadmin -safemode get 
$ hdfs dfsadmin -safemode leave &lt;/PRE&gt;&lt;P&gt;second how to perform the steps as described  in the bash script&lt;/P&gt;&lt;P&gt;is it ok to do the following :&lt;/P&gt;&lt;PRE&gt;su - hdfs -c "hdfs dfsadmin -safemode get"
su - hdfs -c "hdfs dfsadmin -safemode leave" &lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Jan 2018 04:26:45 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2018-01-04T04:26:45Z</dc:date>
    <item>
      <title>how to verify if name node is in safe mode</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-verify-if-name-node-is-in-safe-mode/m-p/179646#M73070</link>
      <description>&lt;P&gt;how to verify if name node is in safe mode ?&lt;/P&gt;&lt;P&gt;goal - in case of name node in safe mode , then bash script will perform the following steps on one of the masters machines &lt;/P&gt;&lt;PRE&gt;# su - hdfs  
$ hdfs dfsadmin -safemode get 
$ hdfs dfsadmin -safemode leave &lt;/PRE&gt;&lt;P&gt;second how to perform the steps as described  in the bash script&lt;/P&gt;&lt;P&gt;is it ok to do the following :&lt;/P&gt;&lt;PRE&gt;su - hdfs -c "hdfs dfsadmin -safemode get"
su - hdfs -c "hdfs dfsadmin -safemode leave" &lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jan 2018 04:26:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-verify-if-name-node-is-in-safe-mode/m-p/179646#M73070</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-01-04T04:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to verify if name node is in safe mode</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-verify-if-name-node-is-in-safe-mode/m-p/179647#M73071</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Yes. You can use the second way to achieve your task. You can also use the below to check if namenode is in SafeMode and leave conditionally.&lt;/P&gt;&lt;PRE&gt;su - hdfs -c "hdfs dfsadmin -safemode get" | grep ON
if [ $? -ne 0 ]
then
  su - hdfs -c "hdfs dfsadmin -safemode leave" 
fi&lt;/PRE&gt;&lt;P&gt;To run the above script, put the content in a file say xyz.sh&lt;/P&gt;&lt;PRE&gt;chmod +x xyz.sh
./xyz.sh&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 11:32:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-verify-if-name-node-is-in-safe-mode/m-p/179647#M73071</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-01-04T11:32:55Z</dc:date>
    </item>
  </channel>
</rss>

