1. 下载
去北京理工大学镜像站下载zookeeper-3.4.10.tar.gz。然后上传到CenOS中。
2. 解压
[root@hao local]# tar -zxvf zookeeper-3.4.10.tar.gz -C /usr/local/
3. 进入解压后的目录,并创建data文件夹
[root@hao local]# cd /usr/local/zookeeper-3.4.10/
[root@hao zookeeper-3.4.10]# mkdir data
4. 进入conf目录,通过zoo_sample.cfg创键zoo.cfg
[root@hao zookeeper-3.4.10]# cd conf/
[root@hao conf]# cp zoo_sample.cfg zoo.cfg
之后,用vim打开zoo.cfg,修改dataDir属性:
dataDir=/usr/local/zookeeper-3.4.10/data
5. 启动服务
进入bin目录,并启动:
[root@hao conf]# cd ../bin/
[root@hao bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
查看启动状态:
[root@hao bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: standalone
关闭服务:
[root@hao bin]# ./zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
网友评论