zookeeper单机版安装
Posted RoyFans
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zookeeper单机版安装相关的知识,希望对你有一定的参考价值。
一、zookeeper单机版安装
下载zookeeper-3.4.6.tar.gz
解压在/opt目录下
在/home/zookeeper-3.4.6目录下创建以下目录:
mkdir data
mkdir logs
将/opt/zookeeper-3.4.6/conf/下的zoo.sample.cfg 文件拷贝一份,命名为zoo.cfg
cp zoo_sample.cfg zoo.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=/tmp/zookeeper
# 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
#
# 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
其他默认,dataDir修改成刚才新建的data目录,同时新增dataLogDir:
dataDir=/home/zookeeper-3.4.9/data
dataLogDir=/home/zookeeper-3.4.9/logs
保存,单机版配置已经完成。
vi /root/.bash_profile
# zookeeper env
export ZOOKEEPER_HOME=/home/zookeeper-3.4.9
export PATH=$ZOOKEEPER_HOME/bin:$PATH
source /root/.bash_profile
启动zk:
zkServer.sh start
查看状态:
zkServer.sh status
以上是关于zookeeper单机版安装的主要内容,如果未能解决你的问题,请参考以下文章