0.ZooKeeper文档
http://zookeeper.apache.org/doc/r3.4.11/zookeeperOver.html
1.准备
在CentOS7上安装zookeeper时,如下工具必须要有:wget
如果没有,则进行安装:
yum -y install wget
2.下载安装
下载到本地
cd /usr/local/src
wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
解压
tar -xzvf zookeeper-3.4.11.tar.gz
创建的安装目录,并移动解压后的目录到其下
mkdir -p ../zookeeper
mv zookeeper-3.4.11/ ../zookeeper
创建数据目录,用于存放数据
mkdir -p /var/lib/zookeeper
创建配置
cd ../zookeeper/zookeeper-3.4.11/conf
cp zoo_sample.cfg zoo.cfg
修改其中配置dataDir:
vi zoo.cfg
dataDir=/var/lib/zookeeper
3.启动服务
cd ..
./bin/zkServer.sh start
输出如下信息,表示启动成功
Connecting to 127.0.0.1:2181
2018-02-09 14:56:10,914 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.11-37e277162d567b55a07d1755f0b31c32e93c01a0, built on 11/01/2017 18:06 GMT
2018-02-09 14:56:10,922 [myid:] - INFO [main:Environment@100] - Client environment:host.name=jiaodacailei-thinkpad-centos7
2018