集群中包括4个节点:2个Master(主备),2个Salve,节点之间局域网连接,可以相互ping通。节点IP地址分布如下:
Hadoop HA集群:
IP地址 |
hostname |
role |
10.12.0.240 |
master |
ActiveNameNode |
10.12.0.243 |
standyMaster |
StandByNameNode |
10.12.0.241 |
slave1 |
DataNode1 |
10.12.0.242 |
slave2 |
DataNode2 |
[wangshumin@CentOSNode1 sbin]$ jps
21153 NameNode
20950 JournalNode
22454 Jps
17370 Master
[wangshumin@CentOSNode1 sbin]$ kill -9 21153
[wangshumin@CentOSNode1 sbin]$ jps
22464 Jps
20950 JournalNode
17370 Master
[wangshumin@CentOSNode1 sbin]$ start-dfs.sh
Starting namenodes on [CentOSNode1 CentOSNode2]
CentOSNode2: namenode running as process 18046. Stop it first.
CentOSNode1: starting namenode, logging to /home/wangshumin/hadoop-2.6.5/logs/hadoop-wangshumin-namenode-CentOSNode1.out
CentOSNode3: starting datanode, logging to /home/wangshumin/hadoop-2.6.5/logs/hadoop-wangshumin-datanode-CentOSNode3.out
Starting journal nodes [CentOSNode1 CentOSNode2 CentOSNode3]
CentOSNode1: journalnode running as process 20950. Stop it first.
CentOSNode2: journalnode running as process 17877. Stop it first.
CentOSNode3: journalnode running as process 56229. Stop it first.
Starting ZK Failover Controllers on NN hosts [CentOSNode1 CentOSNode2]
CentOSNode2: starting zkfc, logging to /home/wangshumin/hadoop-2.6.5/logs/hadoop-wangshumin-zkfc-CentOSNode2.out
CentOSNode1: starting zkfc, logging to /home/wangshumin/hadoop-2.6.5/logs/hadoop-wangshumin-zkfc-CentOSNode1.out
[wangshumin@CentOSNode1 sbin]$ jps
23074 Jps
20950 JournalNode
17370 Master
23002 DFSZKFailoverController
22587 NameNode
[wangshumin@CentOSNode1 sbin]$ jps
20950 JournalNode
17370 Master
23002 DFSZKFailoverController
22587 NameNode
23132 Jps
[wangshumin@CentOSNode1 sbin]$ start-dfs.sh
Starting namenodes on [CentOSNode1 CentOSNode2]
CentOSNode1: namenode running as process 22587. Stop it first.
CentOSNode2: namenode running as process 18046. Stop it first.
CentOSNode3: datanode running as process 58116. Stop it first.
Starting journal nodes [CentOSNode1 CentOSNode2 CentOSNode3]
CentOSNode1: journalnode running as process 20950. Stop it first.
CentOSNode3: journalnode running as process 56229. Stop it first.
CentOSNode2: journalnode running as process 17877. Stop it first.
Starting ZK Failover Controllers on NN hosts [CentOSNode1 CentOSNode2]
CentOSNode1: zkfc running as process 23002. Stop it first.
CentOSNode2: zkfc running as process 18838. Stop it first.
[wangshumin@CentOSNode1 sbin]$ ll
总用量 120
-rwxr-xr-x. 1 wangshumin wangshumin 2752 10月 3 2016 distribute-exclude.sh
-rwxr-xr-x. 1 wangshumin wangshumin 6452 10月 3 2016 hadoop-daemon.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1360 10月 3 2016 hadoop-daemons.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1640 10月 3 2016 hdfs-config.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 1427 10月 3 2016 hdfs-config.sh
-rwxr-xr-x. 1 wangshumin wangshumin 2291 10月 3 2016 httpfs.sh
-rwxr-xr-x. 1 wangshumin wangshumin 2059 10月 3 2016 kms.sh
-rwxr-xr-x. 1 wangshumin wangshumin 4080 10月 3 2016 mr-jobhistory-daemon.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1648 10月 3 2016 refresh-namenodes.sh
-rwxr-xr-x. 1 wangshumin wangshumin 2145 10月 3 2016 slaves.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1779 10月 3 2016 start-all.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 1471 10月 3 2016 start-all.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1128 10月 3 2016 start-balancer.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1401 10月 3 2016 start-dfs.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 3705 10月 3 2016 start-dfs.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1357 10月 3 2016 start-secure-dns.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1571 10月 3 2016 start-yarn.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 1347 10月 3 2016 start-yarn.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1770 10月 3 2016 stop-all.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 1462 10月 3 2016 stop-all.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1179 10月 3 2016 stop-balancer.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1455 10月 3 2016 stop-dfs.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 3206 10月 3 2016 stop-dfs.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1340 10月 3 2016 stop-secure-dns.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1642 10月 3 2016 stop-yarn.cmd
-rwxr-xr-x. 1 wangshumin wangshumin 1340 10月 3 2016 stop-yarn.sh
-rwxr-xr-x. 1 wangshumin wangshumin 4295 10月 3 2016 yarn-daemon.sh
-rwxr-xr-x. 1 wangshumin wangshumin 1353 10月 3 2016 yarn-daemons.sh
[wangshumin@CentOSNode1 sbin]$ start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /home/wangshumin/hadoop-2.6.5/logs/yarn-wangshumin-resourcemanager-CentOSNode1.out
CentOSNode3: starting nodemanager, logging to /home/wangshumin/hadoop-2.6.5/logs/yarn-wangshumin-nodemanager-CentOSNode3.out
[wangshumin@CentOSNode1 sbin]$ jps
20950 JournalNode
23544 ResourceManager
23801 Jps
17370 Master
23002 DFSZKFailoverController
22587 NameNode
[wangshumin@CentOSNode1 sbin]$ s