zookeeper3.4.14 安装


 

zookeeper安装  参考:https://www.cnblogs.com/shaozm/p/10141727.html

下载 : 

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz

cd zookeeper-3.4.14
mkdir data
cd conf mv 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=/home/hadoop/zookeeper-3.4.14/data
dataLogDir=/home/hadoop/zookeeper-3.4.14/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
server.1=192.168.91.112:2888:3888
server.2=192.168.91.113:2888:3888
server.3=192.168.91.114:2888:3888
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

 

备注: server.1 server.2 server.3   是指三台机器

以下两个目录手工创建
dataDir=/home/hadoop/zookeeper-3.4.14/data
dataLogDir=/home/hadoop/zookeeper-3.4.14/log
conf目录下创建java.env
vi
java.env
export JVMFLAGS="-Xms100m -Xmx300m $JVMFLAGS"
设置每台zoomkeeper 的 id
echo "1" > /home/hadoop/zookeeper-3.4.14/data/myid

做好以上配置 之后将整个zookeeper的目录远程拷贝的其他两台机器上
scp -r /home/hadoop/zookeeper-3.4.14 hadoop@slave1:/home/hadoop/
scp -r /home/haddop/zookeeper-3.4.14 hadoop@slave2:/home/hadoop/
并 修改 data/myid 中的内容为 2 (针对server 2即 113机器配置文件)或 3(针对server即114机器配置文件 3)

启动 命令(每台机器都启动)

zookeeper-3.4.14/bin/zkServer.sh start 日志会在启动目录下 生成 zookeeper.out

查看状态命令
zookeeper-3.4.14/bin/zkServer.sh status











 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM