You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "BellaJiangxia (GitHub)" <gi...@apache.org> on 2018/11/01 06:27:35 UTC

[GitHub] [incubator-dubbo] BellaJiangxia opened issue #2723: zookeeper客户端watcher

可以通过命令的形式在客户端建立watcher吗?然后监控服务器的挂掉与否?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
![Uploading T]3MJK}XKL%{7K0Q{9F1UM7.png…]()
我看网上的代码,这个groupNode和subNode这两个变量是需要通过图二这种方式在命令行创建吗

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
建议你看看zk client的文档和用法,或者你可以到zk去提交一个issue。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
图上是用命令,实际操作也可以用代码,你可以看一下ZkclientZookeeperClient代码。

watcher就是监听器,你可以理解为Consumer订阅了一个zk的path,就会注册一个watcher,这个path下就是相应服务的Provider地址,如果新增一个Provider,他就会在这个path下加一条数据,这时候zk会把“在这个path下增加数据”这个事件通知给Consumer,其实就是回调Watcher的方法,这时候Consumer就可以处理相应的事件

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh closed issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
[ issue closed by carryxyh ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
https://github.com/apache/zookeeper

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
目前不行。
监控服务器健康状况使用telnet或者dubbo-ops即可

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
是的。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
        String createPath = zk.create("/"+groupNode+"/"+subNode,address.getBytes("utf-8"), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
        System.out.println("create:"+createPath);
这段代码错了吗?为啥失败了呢,我用的命令式参数
![qse3xou 7viydp3 lur3m9f](https://user-images.githubusercontent.com/31379334/47839371-8c8f7680-dded-11e8-8cce-2877b68c592a.png)
![Uploading (DL7TG~%739K1Z7XI(7W1_N.png…]()



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
提问地址是什么呢?还不太会用这个git

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
你好,zookeeper没人回复,请问你知道为啥要创建子节点吗,直接创建节点不行吗,还有即使客户端能获得子节点的状态了,但是修改子节点完全没有反应

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
我只是学习,那客户端不监控服务端的宕机与否,那这个watcher机制有啥用呢

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
目前不行。
监控服务器健康状况使用telnet或者dubbo-ops即可
还有其他问题么?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
我看网上说建立watcher首先要在服务端注册,是用命令注册还是怎么的

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
是真的不知道####......


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
不是,怎么提问的,我都不知道怎么提问了


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
哦哦,那我那两个图片的问题

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
订阅一下邮件列表,然后发邮件问一下吧
https://zookeeper.apache.org/lists.html

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
不是。下线可以理解为服务端主动操作关机,宕机可以理解为被动关闭比如电源被拔了。
watcher就是服务端主动下线的时候通知客户端使用。
这个问题跟dubbo没有什么关系,我先关闭了,如果你有疑问可以继续在下面留言进行讨论。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
![qse3xou 7viydp3 lur3m9f](https://user-images.githubusercontent.com/31379334/47839415-a630be00-dded-11e8-8ec9-2d33277c2616.png)


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
除了你说的这两种方式,还有就是在Java代码里面进行监控吗

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
这个就是在执行那个创建节点的流程吗
![dl7tg 739k1z7xi 7w1_n](https://user-images.githubusercontent.com/31379334/47838771-5e109c00-ddeb-11e8-875c-9f3e3d975076.png)


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
watcher机制是通知用的。通知客户端服务端下线,这和监控是两回事。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
![ai ch bies dc8t 4 i8 f](https://user-images.githubusercontent.com/31379334/47838023-f78a7e80-dde8-11e8-96d0-35acb105ee21.png)
![t 3mjk xkl 7k0q 9f1um7](https://user-images.githubusercontent.com/31379334/47838027-fb1e0580-dde8-11e8-9f4f-b13e17aa8964.png)
我看网上的代码,这个groupNode和subNode这两个变量是需要通过图二这种方式在命令行创建吗



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
我还不知道这个watcher整个流程到底怎么实现

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2723: zookeeper客户端watcher

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
你想在客户端监听服务端健康情况么?
你能说一下你的业务场景么,我从来没遇到这种需求,我觉得很奇怪,客户端为什么要监控服务端的健康情况呢,服务端宕机,客户端直接就所有请求都会失败,怎么还需要监控呢?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] BellaJiangxia commented on issue #2723: zookeeper客户端watcher

Posted by "BellaJiangxia (GitHub)" <gi...@apache.org>.
不太理解,下线和宕机不是一个意思吗

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2723 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org