分为
(1)分别去3或5节点上去启动Zookeeper进程
(2)自己写个脚本,直接在主节点上去启动Zookeeper进程。
(1)分别去3或5节点上去启动Zookeeper进程
第一步:
[hadoop@HadoopMaster zookeeper-3.4.6]$ pwd
/home/hadoop/app/zookeeper-3.4.6
[hadoop@HadoopMaster zookeeper-3.4.6]$ jps
3113 Jps
[hadoop@HadoopMaster 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@HadoopMaster zookeeper-3.4.6]$ jps
3133 QuorumPeerMain
3146 Jps
[hadoop@HadoopMaster zookeeper-3.4.6]$
第二步:
[hadoop@HadoopSlave1 hadoop-2.6.0]$ cd $ZOOKEEPER_HOME
[hadoop@HadoopSlave1 zookeeper-3.4.6]$ pwd
/home/hadoop/app/zookeeper-3.4.6
[hadoop@HadoopSlave1 zookeeper-3.4.6]$ jps
3088 Jps
[hadoop@HadoopSlave1 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@HadoopSlave1 zookeeper-3.4.6]$ jps
3122 Jps
3109 QuorumPeerMain
[hadoop@HadoopSlave1 zookeeper-3.4.6]$
第三步:
[hadoop@HadoopSlave2 ~]$ cd $ZOOKEEPER_HOME
[hadoop@HadoopSlave2 zookeeper-3.4.6]$ pwd
/home/hadoop/app/zookeeper-3.4.6
[hadoop@HadoopSlave2 zookeeper-3.4.6]$ jps
4511 Jps
[hadoop@HadoopSlave2 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@HadoopSlave2 zookeeper-3.4.6]$ jps
4531 QuorumPeerMain
4545 Jps
[hadoop@HadoopSlave2 zookeeper-3.4.6]$
这里,我以3节点作为演示,5个节点的Zookeeper大同小异,不多赘述。
(2)自己写个脚本,直接在主节点上去启动Zookeeper进程。
[hadoop@djt11 zookeeper]$ runRemoteCmd.sh "/home/hadoop/app/zookeeper/bin/zkServer.sh start" zookeeper
具体,如下博客