Rate This Document
Findability
Accuracy
Completeness
Readability

Starting the Hadoop Cluster

The following operations must be performed in sequence.

  1. Start the ZooKeeper cluster.

    Start ZooKeeper on agent1, agent2, and agent3.

    1
    2
    cd /usr/local/zookeeper/bin
    ./zkServer.sh start
    
  2. Check whether the ZooKeeper cluster is successfully started.
    Run the jps command to check whether the QuorumPeerMain process exists. If it exists, the ZooKeeper cluster is started successfully.
    1
    jps | grep QuorumPeerMain
    
  3. Start JournalNode.

    Start JournalNode on agent1, agent2, and agent3.

    Perform 3 to 6 only when you format the cluster for the first time. After the formatting is complete, you only need to perform 1, 7, and 8 when you start the cluster next time.

    1
    2
    cd /usr/local/hadoop/sbin
    ./hadoop-daemon.sh start journalnode
    
  4. Check whether JournalNode is successfully started.

    Run the jps command to check whether the JournalNode process exists. If it exists, JournalNode is started successfully.

  5. Format HDFS.
    1. Format HDFS on server1.
      1
      hdfs namenode -format
      
    2. After the formatting, the cluster generates a directory based on the hadoop.tmp.dir parameter configured in the core-site.xml file.

      The directory configured in this example is /home/hadoop_tmp_dir.

  6. Format ZKFC.

    Format ZKFC on server1.

    1
    hdfs zkfc -formatZK
    
  7. Start the HDFS.

    Start HDFS on server1.

    1
    2
    cd /usr/local/hadoop/sbin
    ./start-dfs.sh
    
  8. Start Yarn.

    Start Yarn on server1.

    1
    2
    cd /usr/local/hadoop/sbin
    ./start-yarn.sh
    
  9. Check whether all processes are started properly.

    Perform this operation on each node to check whether all processes are started properly. (The following figures show the processes to be started on server1 and agent1, respectively. The processes to be started on other server nodes and agent nodes are similar.)

    1
    jps