zookeeper 命令 查看发布的服务提供者和消费者 Posted on 2018-02-18 | Edited on 2019-02-02 | In registration center 1234567891011121314151617181920212223242526272829303132333435363738394041424344[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# pwd/usr/local/zookeeper/zookeeper-3.4.10/bin[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# ./zkCli.sh -server 127.0.0.1:2181Connecting to 127.0.0.1:21812018-02-18 21:30:05,213 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT2018-02-18 21:30:05,216 [myid:] - INFO [main:Environment@100] - Client environment:host.name=iZuf6iq8e7ya9v3ix71k0pZ2018-02-18 21:30:05,216 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_1112018-02-18 21:30:05,218 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation2018-02-18 21:30:05,218 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/java/jdk1.8.0_111/jre2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/local/zookeeper/zookeeper-3.4.10/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.10/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.10/bin/../conf:2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=<NA>2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux2018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd642018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:os.version=3.10.0-514.26.2.el7.x86_642018-02-18 21:30:05,219 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root2018-02-18 21:30:05,220 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root2018-02-18 21:30:05,220 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/usr/local/zookeeper/zookeeper-3.4.10/bin2018-02-18 21:30:05,221 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dcWelcome to ZooKeeper!2018-02-18 21:30:05,243 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)JLine support is enabled2018-02-18 21:30:05,308 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@876] - Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session2018-02-18 21:30:05,315 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x161a83a11fc0007, negotiated timeout = 30000WATCHER::WatchedEvent state:SyncConnected type:None path:null[zk: 127.0.0.1:2181(CONNECTED) 0] ls /[dubbo, zookeeper][zk: 127.0.0.1:2181(CONNECTED) 1] ls /dubbo[com.smniuhe.service.ItemService][zk: 127.0.0.1:2181(CONNECTED) 2] ls /dubbo/com.smniuhe.service.ItemService/providers[][zk: 127.0.0.1:2181(CONNECTED) 3]现在我通过 tomcat maven 插件 tomcat7:run 发布该服务[zk: 127.0.0.1:2181(CONNECTED) 3] ls /dubbo/com.smniuhe.service.ItemService/providers[dubbo%3A%2F%2F192.168.0.28%3A20880%2Fcom.smniuhe.service.ItemService%3Fanyhost%3Dtrue%26application%3Dtaotao-manager%26dubbo%3D2.8.4%26generic%3Dfalse%26interface%3Dcom.smniuhe.service.ItemService%26methods%3DgetTbItemById%26pid%3D31972%26revision%3D1.0-SNAPSHOT%26side%3Dprovider%26timestamp%3D1518960843164] # 当前发布服务器的时间戳[zk: 127.0.0.1:2181(CONNECTED) 4] ls /dubbo/com.smniuhe.service.ItemService/configurators providers