zookeeper3.4.14 安装
Posted bjxdd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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)或 3(seerver 3)
启动 命令
zookeeper-3.4.14/bin/zkServer.sh start 日志会在启动目录下 生成 zookeeper.out
查看状态命令
zookeeper-3.4.14/bin/zkServer.sh status
以上是关于zookeeper3.4.14 安装的主要内容,如果未能解决你的问题,请参考以下文章