以下出现的dblater为用户名
安装
官网下载地址:https://zookeeper.apache.org/
以apache-zookeeper-3.5.7-bin.tar.gz为例
(1)安装JDK
(2)拷贝apache-zookeeper-3.5.7-bin.tar.gz安装包到Linux系统下
(3)解压到指定目录
[dblater@hadoop102 software]$ tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz-C /opt/module/
(4)修改名称
[dblater@hadoop102 module]$ mv apache-zookeeper-3.5.7-bin/zookeeper-3.5.7
配置
(1)将/opt/module/zookeeper-3.5.7/conf这个路径下的zoo_sample.cfg修改为zoo.cfg;
[dblater@hadoop102 conf]$ mv zoo_sample.cfg zoo.cfg
(2)打开zoo.cfg文件,修改dataDir路径:
[dblater@hadoop102 zookeeper-3.5.7]$ vim zoo.cfg
修改如下内容:
dataDir=/opt/module/zookeeper-3.5.7/zkData
(3)在/opt/module/zookeeper-3.5.7/这个目录上创建zkData文件夹
[dblater@hadoop102 zookeeper-3.5.7]$ mkdir zkData
操作Zookeeper
(1)启动Zookeeper
[dblater@hadoop102 zookeeper-3.5.7]$ bin/zkServer.sh start
(2)查看进程是否启动
[dblater@hadoop102 zookeeper-3.5.7]$ jps
4020 Jps
4001 QuorumPeerMain
(3)查看状态
[dblater@hadoop102 zookeeper-3.5.7]$ bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg
Mode: standalone</