CentOS 安装 Zookeeper 版本任选

Zookeeper下载地址各种版本自己选择:
Zookeeper 3.4.13版本下载地址:
 
安装: 
1.确保 wget、tar 已经安装:
sudo yum install wget
sudo yum install tar
2.安装Zookeeper:
---创建zookeeper文件夹
mkdir -p /usr/local/dev/zookeeper
---进入刚刚创建的zookeeper文件夹
cd /usr/local/dev/zookeeper
---下载zookeeper
---解压zookeeper
tar zxvf zookeeper-3.4.13.tar.gz
---删掉不要的zookeeper包
rm -f zookeeper-3.4.13.tar.gz
---添加环境变量, 编辑profile文件
vim /etc/profile
---在其末尾追加如下内容
#zookeeper export ZOOKEEPER_INSTALL=/usr/local/dev/zookeeper/zookeeper-3.4.13 export PATH=$PATH:$ZOOKEEPER_INSTALL/bin
---进入配置文件目录
cd /usr/local/dev/zookeeper/zookeeper-3.4.13/conf
---创建ZooKeeper配置文件
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=/tmp/zookeeper/data
dataLogDir=/tmp/zookeeper/log
# the port at which the clients will connect
clientPort=2181
---创建data目录
mkdir -p /tmp/zookeeper/data
---创建log日志目录
mkdir -p /tmp/zookeeper/log
---进入bin目录
cd /usr/local/dev/zookeeper/zookeeper-3.4.13/bin
---启动ZooKeeper
./zkServer.sh start
---在这里,我们可以使用ZooKeeper自带的客户端工具zkCli.sh来查看节点的建立情况,执行如下命令打开z----kCli.sh客户端
./zkCli.sh
 
 
参考文档: 
 
 
 
 
 
上一篇:Unity运动残影技能


下一篇:删除链表的倒数第N个节点