Hadoop 安裝完成後,Hadoop官網文件以及一些網路的教學都建議執行 start-dfs.sh 以及 start-yarn.sh 來啟動 Hadoop system。在Hadoop 2.4.0的安裝目錄 $HADOOP_INSTALL/sbin 提供了一些shell scripts:
- start-all.sh : Starts all Hadoop daemons, the namenode, datanodes, the jobtracker and tasktrackers. Deprecated; usestart-dfs.sh then start-yarn.sh
- start-dfs.sh : Starts the Hadoop DFS daemons, the namenode and datanodes. Use this before start-yarn.sh
- start-yarn.sh : Start all yarn daemons, the resourcemanager and nodemanager. Run this on master node
- start-balancer.sh : Run for HDFS Balancer.
- start-secure-dns.sh : Run as root to start secure datanodes in a security-enabled cluster.
執行 start-dfs.sh 將啟動 namenode, secondarynamenode 及 datanodes。
- NameNode daemon - Only one daemon runs for entire hadoop cluster.
- Secondary NameNode daemon – Only one daemon runs for entire hadoop cluster.
- DataNode daemon – One datanode daemon per each datanode in hadoop cluster
hduser@HDSingle:/usr/local/hadoop/sbin$ jps 2750 DataNode 2932 SecondaryNameNode 4218 Jps 2619 NameNode
也可以分別啟動。
$ hadoop-daemon.sh shart namenode $ hadoop-daemon.sh shart secondarynamenode $ hadoop-daemon.sh shart datanode
start-yarn.sh 將啟動 YARN 的 daemon processes:
- ResourceManager - Master daemon process
- NodeManager – One Slave daemon process per node in a cluster.
用 jps命令檢視實行的結果:
hduser@HDSingle:/usr/local/hadoop/sbin$ jps 2750 DataNode 2932 SecondaryNameNode 4581 NodeManager 4789 Jps 2619 NameNode 4441 ResourceManager
停止daemons的scripts有:
- stop-all.sh
- stop-balancer.sh
- stop-dfs.sh
- stop-secure-dns.sh
- stop-yarn.sh
Reference:
http://yanbohappy.sinaapp.com/?p=130
http://docs.oracle.com/javase/8/docs/technotes/tools/unix/jps.html
http://hadooptutorial.info
http://blog.csdn.net/suileisl/article/details/11717537
沒有留言:
張貼留言