方式一:逐一啓動(實際生產環境中的啓動方式)node
hadoop-daemon.sh start|stop namenode|datanode| journalnodessh
yarn-daemon.sh start |stop resourcemanager|nodemanageroop
方式二:分開啓動spa
start-dfs.sh進程
start-yarn.shhadoop
方式三:一塊兒啓動get
start-all.sh
登錄
start-dfs.sh腳本:配置
(1) 經過命令bin/hdfs getconf –namenodes查看namenode在那些節點上密碼
(2) 經過ssh方式登陸到遠程主機,啓動hadoop-deamons.sh腳本
(3) hadoop-deamon.sh腳本啓動slaves.sh腳本
(4) slaves.sh腳本啓動hadoop-deamon.sh腳本,再逐一啓動
start-all.sh腳本:
說明:start-all.sh其實是調用sbin/start-dfs.sh腳本和sbin/start-yarn.sh腳本
start-all.sh其實調用start-dfs.sh和start-yarn.sh
start-dfs.sh調用hadoop-deamon.sh
start-yarn.sh調用yarn-deamon.sh
以下圖:
當執行start-dfs.sh腳本時,會調用slaves.sh腳本,經過ssh協議無密碼登錄到其餘節點去啓動進程。
爲了能自動啓動遠程節點的進程,須要進行免密碼登陸。
上面已經配置好了ssh公鑰登陸,接下來用第二種啓動方式啓動
Step1:先中止因此進程(若是已經啓動)
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/yarn-daemon.sh stop nodemanager
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/yarn-daemon.sh stop resourcemanager
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/hadoop-daemon.sh stop datanode
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/hadoop-daemon.sh stop secondarynamenode
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/hadoop-daemon.sh stop namenode
Step2:啓動因此進程
[hadoop@hadoop-yarn hadoop-2.2.0]$sbin/start-dfs.sh
[hadoop@hadoop-yarn hadoop-2.2.0]$ sbin/start-yarn.sh
Step3:查看管理界面
YARN: http://hadoop-yarn.dragon.org:8088/
HDFS: http://hadoop-yarn.dragon.org:50070/