Namenode not getting started

前端 未结 21 2041
暗喜
暗喜 2020-11-28 19:32

I was using Hadoop in a pseudo-distributed mode and everything was working fine. But then I had to restart my computer because of some reason. And now when I am trying to st

相关标签:
21条回答
  • 2020-11-28 19:49

    Open a new terminal and start the namenode using path-to-your-hadoop-install/bin/hadoop namenode

    The check using jps and namenode should be running

    0 讨论(0)
  • 2020-11-28 19:49

    For me the following worked after I changed the directory of the namenode and datanode in hdfs-site.xml

    -- before executing the following steps stop all services with stop-all.sh or in my case I used the stop-dfs.sh to stop the dfs

    1. On the new configured directory, for every node (namenode and datanode), delete every folder/files inside it (in my case a 'current' directory).
    2. delete the Hadoop temporary directory: $rm -rf /tmp/haddop-$USER
    3. format the Namenode: hadoop/bin/hdfs namenode -format
    4. start-dfs.sh

    After I followed those steps my namenode and datanodes were alive using the new configured directory.

    0 讨论(0)
  • 2020-11-28 19:52

    In core-site.xml:

        <configuration>
           <property>
              <name>fs.defaultFS</name>
              <value>hdfs://localhost:9000</value>
           </property>
           <property>
              <name>hadoop.tmp.dir</name>
              <value>/home/yourusername/hadoop/tmp/hadoop-${user.name}
             </value>
      </property>
    </configuration>
    

    and format of namenode with :

    hdfs namenode -format

    worked for hadoop 2.8.1

    0 讨论(0)
  • 2020-11-28 19:52

    I ran into the same thing after a restart.

    for hadoop-2.7.3 all I had to do was format the namenode:

    <HadoopRootDir>/bin/hdfs namenode -format
    

    Then a jps command shows

    6097 DataNode
    755 RemoteMavenServer
    5925 NameNode
    6293 SecondaryNameNode
    6361 Jps
    
    0 讨论(0)
  • 2020-11-28 19:55

    If your namenode is stuck in safemode you can ssh to namenode, su hdfs user and run the following command to turn off safemode:

    hdfs dfsadmin -fs hdfs://server.com:8020 -safemode leave
    
    0 讨论(0)
  • 2020-11-28 19:56

    Following STEPS worked for me with hadoop 2.2.0,

    STEP 1 stop hadoop

    hduser@prayagupd$ /usr/local/hadoop-2.2.0/sbin/stop-dfs.sh
    

    STEP 2 remove tmp folder

    hduser@prayagupd$ sudo rm -rf /app/hadoop/tmp/
    

    STEP 3 create /app/hadoop/tmp/

    hduser@prayagupd$ sudo mkdir -p /app/hadoop/tmp
    hduser@prayagupd$ sudo chown hduser:hadoop /app/hadoop/tmp
    hduser@prayagupd$ sudo chmod 750 /app/hadoop/tmp
    

    STEP 4 format namenode

    hduser@prayagupd$ hdfs namenode -format
    

    STEP 5 start dfs

    hduser@prayagupd$ /usr/local/hadoop-2.2.0/sbin/start-dfs.sh
    

    STEP 6 check jps

    hduser@prayagupd$ $ jps
    11342 Jps
    10804 DataNode
    11110 SecondaryNameNode
    10558 NameNode
    
    0 讨论(0)
提交回复
热议问题