hadoop集群启动

杀马特。学长 韩版系。学妹 提交于 2020-03-17 10:41:19
1.启动zk

第一台# 
```[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ bin/zkServer.sh start
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ jps
2720 Jps
2695 QuorumPeerMain
[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: follower
[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ 

第二台
[hadoop@iZm5egvghvhhyj2r5iixeuZ ~]$ cd $ZOOKEEPER_HOME/bin/zkServer.sh status
-bash: cd: /home/hadoop/app/zookeeper-3.4.6/bin/zkServer.sh: Not a directory
[hadoop@iZm5egvghvhhyj2r5iixeuZ ~]$ cd $ZOOKEEPER_HOME
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ bin/zkServer.sh start
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ jps
2232 Jps
2207 QuorumPeerMain
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: follower
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ 

第三台


[hadoop@iZm5egvghvhhyj2r5iixevZ ~]$ cd $ZOOKEEPER_HOME/bin/zkServer.sh status
-bash: cd: /home/hadoop/app/zookeeper-3.4.6/bin/zkServer.sh: Not a directory
[hadoop@iZm5egvghvhhyj2r5iixevZ ~]$ cd $ZOOKEEPER_HOME
[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ bin/zkServer.sh start
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ jps
2205 Jps
2174 QuorumPeerMain
[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ bin/zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: leader
[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ 



2.启动journalnode
第一台
[hadoop@iZm5egvghvhhyj2r5iixetZ zookeeper-3.4.6]$ cd ~/app/hadoop-2.6.0-cdh5.7.0
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ sbin/hadoop-daemon.sh start journalnode
starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixetZ.out
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ jps
2695 QuorumPeerMain
2826 Jps
2779 JournalNode
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ 

第二台
[hadoop@iZm5egvghvhhyj2r5iixeuZ zookeeper-3.4.6]$ cd ~/app/hadoop-2.6.0-cdh5.7.0
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ sbin/hadoop-daemon.sh start journalnode
starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixeuZ.out
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ jps
2338 Jps
2291 JournalNode
2207 QuorumPeerMain
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ 

第三台

[hadoop@iZm5egvghvhhyj2r5iixevZ zookeeper-3.4.6]$ cd ~/app/hadoop-2.6.0-cdh5.7.0
[hadoop@iZm5egvghvhhyj2r5iixevZ hadoop-2.6.0-cdh5.7.0]$ sbin/hadoop-daemon.sh start journalnode
starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixevZ.out
[hadoop@iZm5egvghvhhyj2r5iixevZ hadoop-2.6.0-cdh5.7.0]$ jps
2311 Jps
2264 JournalNode
2174 QuorumPeerMain
[hadoop@iZm5egvghvhhyj2r5iixevZ hadoop-2.6.0-cdh5.7.0]$ 

3.选第一台做namenode格式化
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ hadoop namenode -format

[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ scp -r data hadoop002:/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/

4.初始化zkfc---第一台上做
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ hdfs zkfc -formatZK

5.启动hdfs
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ sbin/start-dfs.sh
20/03/13 21:49:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [hadoop001 hadoop002]
hadoop001: starting namenode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-namenode-iZm5egvghvhhyj2r5iixetZ.out
hadoop002: starting namenode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-namenode-iZm5egvghvhhyj2r5iixeuZ.out
hadoop003: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-datanode-iZm5egvghvhhyj2r5iixevZ.out
hadoop001: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-datanode-iZm5egvghvhhyj2r5iixetZ.out
hadoop002: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-datanode-iZm5egvghvhhyj2r5iixeuZ.out
Starting journal nodes [hadoop001 hadoop002 hadoop003]
hadoop002: starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixeuZ.out
hadoop003: starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixevZ.out
hadoop001: starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-iZm5egvghvhhyj2r5iixetZ.out
20/03/13 21:50:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting ZK Failover Controllers on NN hosts [hadoop001 hadoop002]
hadoop002: starting zkfc, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-zkfc-iZm5egvghvhhyj2r5iixeuZ.out
hadoop001: starting zkfc, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-zkfc-iZm5egvghvhhyj2r5iixetZ.out
第一台
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ jps
6224 NameNode
6514 JournalNode
6325 DataNode
6694 DFSZKFailoverController
2695 QuorumPeerMain
6762 Jps
第二台
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ jps
3794 NameNode
4130 Jps
4084 DFSZKFailoverController
3865 DataNode
3962 JournalNode
2207 QuorumPeerMain
第三台
[hadoop@iZm5egvghvhhyj2r5iixevZ hadoop-2.6.0-cdh5.7.0]$ jps
3338 Jps
3181 DataNode
3278 JournalNode
2174 QuorumPeerMain

6.启动yarn
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/yarn-hadoop-resourcemanager-iZm5egvghvhhyj2r5iixetZ.out
hadoop003: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/yarn-hadoop-nodemanager-iZm5egvghvhhyj2r5iixevZ.out
hadoop002: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/yarn-hadoop-nodemanager-iZm5egvghvhhyj2r5iixeuZ.out
hadoop001: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/yarn-hadoop-nodemanager-iZm5egvghvhhyj2r5iixetZ.out
第一台
[hadoop@iZm5egvghvhhyj2r5iixetZ hadoop-2.6.0-cdh5.7.0]$ jps
6224 NameNode
6514 JournalNode
6325 DataNode
6694 DFSZKFailoverController
2695 QuorumPeerMain
6905 NodeManager
6809 ResourceManager
6959 Jps

第二台
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ jps
3794 NameNode
4339 Jps
4084 DFSZKFailoverController
4196 NodeManager
3865 DataNode
3962 JournalNode
2207 QuorumPeerMain
第三台
[hadoop@iZm5egvghvhhyj2r5iixevZ hadoop-2.6.0-cdh5.7.0]$ jps
3376 NodeManager
3494 Jps
3181 DataNode
3278 JournalNode
2174 QuorumPeerMain



手工启动第二台的yarn的resourcenamager
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ yarn-daemon.sh start resourcemanager
starting resourcemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/yarn-hadoop-resourcemanager-iZm5egvghvhhyj2r5iixeuZ.out
[hadoop@iZm5egvghvhhyj2r5iixeuZ hadoop-2.6.0-cdh5.7.0]$ jps
3794 NameNode
4084 DFSZKFailoverController
4196 NodeManager
4424 ResourceManager
3865 DataNode
3962 JournalNode
4462 Jps
2207 QuorumPeerMain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!