Zookeeper 本地安装
Zookeeper下载地址:https://archive.apache.org/dist/zookeeper/
步骤一:安装 JDK
步骤二:拷贝 apache-zookeeper-3.5.7-bin.tar.gz 安装包到 Linux 系统下
步骤三:解压到指定目录
tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/
步骤四:修改名称
mv apache-zookeeper-3.5.7-bin/ zookeeper-3.5.7
配置修改
步骤一:将/opt/module/zookeeper-3.5.7/conf 这个路径下的 zoo_sample.cfg 修改为 zoo.cfg
mv zoo_sample.cfg zoo.cfg
步骤二:打开 zoo.cfg 文件,修改 dataDir 路径
vim zoo.cfg
修改如下内容:
dataDir=/opt/module/zookeeper-3.5.7/zkData
步骤三:在/opt/module/zookeeper-3.5.7/这个目录上创建 zkData 文件夹
mkdir zkData
操作 Zookeeper
1、启动 Zookeepe
[root@hadoop102 zookeeper-3.5.7]# ./bin/zkServer.sh start
2、查看状态
[root@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 Client port found: 2181. Client address: localhost. Mode: standalone
3、启动客户端
[root@hadoop102 zookeeper-3.5.7]# bin/zkCli.sh
4、退出客户端
[zk: localhost:2181(CONNECTED) 0] quit
5、停止 Zookeeper
[root@hadoop102 zookeeper-3.5.7]# bin/zkServer.sh stop