1. Format and Start HDFS

  1. Execute these commands on the NameNode host machine:

    su $HDFS_USER
    /usr/lib/hadoop/bin/hadoop namenode -format
    /usr/lib/hadoop/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR start namenode
  2. Execute these commands on the SecondaryNameNode:

    su $HDFS_USER
    /usr/lib/hadoop/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR start secondarynamenode
  3. Execute these commands on all DataNodes:

    su $HDFS_USER
    /usr/lib/hadoop/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR start datanode

where:

  • $HDFS_USER is the user owning the HDFS services. For example, hdfs.

  • $HADOOP_CONF_DIR is the directory for storing the Hadoop configuration files. For example, /etc/hadoop/conf.


loading table of contents...