3. Start HDFS

  • Start HDFS.

    To start HDFS, run commands as the $HDFS_USER.

    1. Start the NameNode. On the NameNode host machine, execute the following command:

      su $HDFS_USER
      export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec
      /usr/lib/hadoop/sbin/hadoop-daemon.sh start namenode -upgrade
                             

      On a large system, this can take a long time to complete.

      [Note]Note

      Run this command with the -upgrade option only once. After you have completed this step, you can bring up the NameNode using this command without including the -upgrade option.

    2. Verify that the NameNode is up and running:

      ps -ef|grep -i NameNode
    3. Start the Secondary NameNode. On the Secondary NameNode host machine, execute the following command:

      su $HDFS_USER
      export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec
      /usr/lib/hadoop/sbin/hadoop-daemon.sh start secondarynamenode 

    4. Verify that the Secondary NameNode is up and running:

      ps -ef|grep  SecondaryNameNode
    5. [Note]Note

      If you are working on a non-secure DataNode, use $HDFS_USER. For a secure DataNode, use root.

      Start DataNodes. On all the DataNodes, execute the following command:

      export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec 
      /usr/lib/hadoop/sbin/hadoop-daemon.sh start datanode              
    6. Verify that the DataNode process is up and running:

      ps -ef|grep DataNode
    7. Verify that NameNode can go out of safe mode.

      hdfs dfsadmin -safemode wait
      Safemode is OFF

      In general, it takes 5-10 minutes to get out of safemode. For thousands of nodes with millions of data blocks, getting out of safemode could take up to 45 minutes.


loading table of contents...