linux 安装 zookeeper

安装kafka之前需要安装zk,所以就分开了...

 

linux安装单节点的zookeeper还是相对简单点儿的,先简单记录一下;

 

下载使用的版本是 zookeeper-3.4.14.tar.gz..

 

解压

到/home/soft后,

tar -zxvf zookeeper-3.4.14.tar.gz

解压,修改配置文件: cp zoo.sample.cfg 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/soft/data/zookeeper/data
dataLogDir=/home/soft/data/zookeeper/logs
# 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

其实也不需要改什么东西,直接用默认的配置即可...

 

配置环境变量

vi /etc/profile

添加

export ZOOK=/home/soft/zookeeper-3.4.14
source /etc/profile

使配置生效..

进入/home/soft/zookeeper-3.4.14/bin目录下

./zkServer.sh start

启动程序....

./zkServer.sh status

查看zk状态

./zkServer.sh stop 停止zk

程序是在的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章