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

程序是在的

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