zookeeper
zookeeper
下载:
http://zookeeper.apache.org/releases.html
zookeeper-3.4.9
安装(依赖jdk)
cd /usr/local
rz
tar -zxvf zookeeper-3.4.9.tar.gz
rm zookeeper-3.4.9.tar.gz
mv zookeeper-3.4.9 zookeeper
cd /usr/local/zookeeper/conf/
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg 修改添加如下内容:
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/log
zoo.cfg文件最后添加如下内容:
# 2888端口是zookeeper服务之间的通讯的端口,3888是zookeeper与其他应用程序通讯的端口。
server.1=localhost:2888:3888
vim /etc/profile 添加如下内容:
export ZOOKEEPER_HOME=/usr/local/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME/bin
source /etc/profile #立即生效
启动
/usr/local/zookeeper/bin/zkServer.sh start
/usr/local/zookeeper/bin
/zkCli.sh -server localhost:2181 #检验服务器命令
停止
/usr/local/zookeeper/bin/zkServer.sh stop