Hadoop Elephant Tour 008- start and close Hadoop
sinom
Hadoop is a Distributed file system running on a Linux file system that needs to be started before it can be used.
1.Hadoop the startup command store location
referring to the method described in the previous section, use the SecureCRTPortable.exe Login CentOS;
use the command " cd/usr/local/hadoop " or"cd $HADOOP _home" into Hadoop root directory ;
use the command " ll" look at the directory structure as shown in:
which D represents a folder,- The presentation file that begins with
the start-up and shutdown we use Hadoop the commands are in bin under the catalogue;
Use the command " cd $HADOOP _home/bin " into this directory ;
use the command " ll" look at the directory structure as shown in:
2. Format File system
HDFs is a file system, so you need to format it before you use it for the first time.
Execute command " hadoopnamenode –format"
After formatting succeeds, as shown in:
Attention:
Format the first time only, not every time you start.
if it is really necessary to format again, please first " Hadoop.tmp.dir "The files under the directory are all deleted.
readers can observe the catalogue themselves " Hadoop.tmp.dir "Changes before and after formatting.
There are few scenarios in which a format operation fails. If it does appear, check that the configuration is correct.
3. start Hadoop
after formatting is complete, start start Hadoop program.
since we are using pseudo-distributed installation mode, it is necessary for a single machine to run all Hadoop process;
Here we use the command " start-all.sh" start all Hadoop processes as shown in:
Note the boot order is: Namenode->datanode->secondarynamenode->jobtracker->tasktracker
use the command " JPS" command to see if the process started successfully, as shown in the 5 processes, it is successful:
4 Close Hadoop
Close Hadoop The command for all processes is " stop-all.sh", as shown in:
when you finish executing the close command, use the JPS "The command will not see Hadoop of the 5 a process.
Note the closing order is: Jobtracker->tasktracker–>namenode->datanode->secondarynamenode
5. Start the process individually
of course, you can also start each process separately instead of starting it together, and the specific command is " $HADOOP _home/bin/ "directory, as shown in:
Execute command start-dfs.sh HDFs, hdfs storage not used MapReduce stop-dfs.sh
Execute command start-mapred.sh MapReduce stop-mapred.sh
of course, you can start it first. MapReduce , and then start HDFS , which shows that HDFS and the MapReduce processes are independent of each other and have no dependencies.
6. How to start failure
To check before starting:
The configuration file is correct
whether IP and Hostname are bound
Have you formatted the NameNode
SSH password-free login setting is successful
if it still fails to start, you can go to the $HADOOP _home/logs/ "Directory to view the error log (this folder is Hadoop when started, automatically generated) analyzes the cause of the error, as shown in:
file naming is regular, " hadoop-[ Current user name ]-[ node name ]-[ host name ].log "We only view Log end of the file.
if it is Namenode node does not start, view Hadoop-root-namenode-book0.log files, and so on.
7. accessing Hadoop using a browser
Use Http://hadoop001:50070 can access the namenode server as shown in :
can be accessed, it explains Namenode is online, which also shows that Namenode is a Webserver Server
Use Http://hadoop001:50030 can access the jobtracker server as shown in
can be accessed, it explains Jobtracker is online, which also shows that Jobtracker is a Webserver Server
Hadoop Elephant Tour 008-Start and close Hadoop