1.下载安装包
wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
2解压
tar -zxvf zookeeper-3.4.14.tar.gz
3.这一步可以省略
cd zookeeper-3.4.14/conf/
cp zoo_sample.cfg zoo.cfg
vi 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.
- dataDir=/usr/zookeeper
- dataLogDir=/usr/zookeeper/log
- # the port at which the clients will connect
- clientPort=2181
- server.1=192.168.147.128:3888
4 设置环境变量
export ZOOKEEPER_INSTALL=/export/jss/zookeeper-3.4.14
export PATH=$PATH:$ZOOKEEPER_INSTALL/bin
5连接zk
zkCli.sh -server zk的ip:2181
6查看目录信息
ls /
结果显示
[dubbo, isr_change_notification, drs-job, zookeeper, servers]
查看服务
ls /dubbo/com.hshbic.cloud.permission.client.PermissionService
查看消费者
ls /dubbo/com.hshbic.cloud.permission.client.PermissionService/consumers
查看提供者
ls /dubbo/com.hshbic.cloud.permission.client.PermissionService/providers
结果中包含ip和端口号
7退出
quit