Big Data Architect’s Handbook
上QQ阅读APP看书,第一时间看更新

Hadoop server start and stop

Now it's time to start our Hadoop server. But, before we proceed further, it's a part of the recommended practices to format NameNode for the first time before we do so. NameNode contains the metadata of the directory tree of all the files in DataNodes. The purpose of formatting NameNode is to utilize all the space available in DataNodes even if any unutilized data is stored. Execute the following command to format it:

$ bin/hdfs namenode -format

To start your Hadoop server, execute the following command:

$ sbin/start-dfs.sh
$ sbin/start-yarn.sh

Open your browser and type in http://localhost:50070/ to see an overview of your Hadoop Server. This web interface gives a lot of useful information, including a NameNode overview, the number of live DataNodes, the number of dead DataNodes, your overall storage capacity and its utilization, startup progress, and access to log files. The web interface will be similar to the following figure:

Figure-2.4.5

For Linux terminals, you can also verify that all services are running by executing the following command:

$ jps

You will get an output similar to the following image: 

To stop the Hadoop server, execute the following command:

$ sbin/stop-dfs.sh
$ sbin/stop-yarn.sh

You can verify whether all services related to Hadoop have been stopped by again running the jps command. You will get an output similar to Figure-2.4.7. Now, you will not see any of the services, such as DataNode, ResourceManager, and so on in the list:

$ jps

Figure-2.4.7