zookeeper3.4.6安装

Posted 听雨轩主

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zookeeper3.4.6安装相关的知识,希望对你有一定的参考价值。

1.关闭防火墙
service iptables stop
chkconfig iptables off
2.编辑hosts文件:
vi /etc/hosts
192.168.99.6 JacK6
192.168.99.7 JacK7
192.168.99.8 JacK8
 
tar -xvf zookeeper-3.5.0.tar.gz -C /data/hadoop/Zookeeper_3.5.0
mkdir -p /data/tmp_data/zookeeper/data
mkdir -p /data/tmp_data/zookeeper/logs
 
cd /data/hadoop/Zookeeper_3.5.0/conf/
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/data/tmp_data/zookeeper/data
dataLogDir=/data/tmp_data/zookeeper/logs
# the port at which the clients will connect
clientPort=2181
server.1=JacK6:2888:3888
server.2=JacK7:2888:3888
server.3=JacK8:2888:3888
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
 
cd ../..
scp -r Zookeeper_3.5.0 JacK7:/data/hadoop/
scp -r Zookeeper_3.5.0 JacK8:/data/hadoop/
 
cd /data/tmp_data/zookeeper/data/ 每台机器不一样
vi myid
#标识机器1为1
 
cd /data/hadoop/Zookeeper_3.5.0/bin/
sh zkServer.sh start
#三个节点都启动完之后在查看状态
ps -ef | grep zookeeper | grep -v grep
sh zkServer.sh status
JMX enabled by default
Using config: /data/hadoop/Zookeeper_3.5.0/bin/../conf/zoo.cfg
Mode: follower
JMX enabled by default
Using config: /data/hadoop/Zookeeper_3.5.0/bin/../conf/zoo.cfg
Mode: leader
sh zkServer.sh stop
 
[email protected] bin]$ ./zkServer.sh start-foreground
JMX enabled by default
Using config: /data/hadoop/Zookeeper_3.5.0/bin/../conf/zoo.cfg
2017-10-23 21:07:00,452 [myid:] - INFO [main:[email protected]] - Reading configuration from: /data/hadoop/Zookeeper_3.5.0/bin/../conf/zoo.cfg
2017-10-23 21:07:00,474 [myid:] - ERROR [main:[email protected]] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Address unresolved: JacK6:3888
at org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer.<init>(QuorumPeer.java:205)
at org.apache.zookeeper.server.quorum.flexible.QuorumMaj.<init>(QuorumMaj.java:89)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.createQuorumVerifier(QuorumPeerConfig.java:401)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseDynamicConfig(QuorumPeerConfig.java:425)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:291)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:126)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:110)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Invalid config, exiting abnormally
因为有空格
 

以上是关于zookeeper3.4.6安装的主要内容,如果未能解决你的问题,请参考以下文章

原创zookeeper3.4.6集群安装

Kafka 0.9+Zookeeper3.4.6集群搭建配置,新版Java Client的使用要点,高可用性测试,以及各种坑

Solr5.5.4+Zookeeper3.4.6+Tomcat8搭建SolrCloud集群

Linux部署Apache Solr5.5.2+Apache Zookeeper3.4.6

Hadoop2.7.3+HBase1.2.5+ZooKeeper3.4.6搭建分布式集群环境

单机ZooKeeper配置