weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.9k stars 1.78k forks source link

使用Yar协议之后,php作为客户端,服务端用zookeeper服务发现如何配置 #559

Open JerryChaox opened 7 years ago

JerryChaox commented 7 years ago

2017-10-26 10:05:21,324 - INFO [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181 2017-10-26 10:05:31,638 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /127.0.0.1:54356 2017-10-26 10:05:31,651 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /127.0.0.1:54356 2017-10-26 10:05:31,653 - INFO [SyncThread:0:FileTxnLog@199] - Creating new log file: log.1 2017-10-26 10:05:31,665 - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x15f566d40370000 with negotiated timeout 5000 for client /127.0.0.1:54356 2017-10-26 10:05:43,899 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /127.0.0.1:54358 2017-10-26 10:05:43,900 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@357] - caught end of stream exception EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:230) at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) at java.lang.Thread.run(Thread.java:748) 2017-10-26 10:05:43,905 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1008] - Closed socket connection for client /127.0.0.1:54358 (no session established for client) 2017-10-26 10:05:44,309 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /127.0.0.1:54360 2017-10-26 10:05:44,311 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /127.0.0.1:54360 2017-10-26 10:05:44,313 - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x15f566d40370001 with negotiated timeout 40000 for client /127.0.0.1:54360 2017-10-26 10:05:44,338 - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@651] - Got user-level KeeperException when processing sessionid:0x15f566d40370001 type:create cxid:0x4 zxid:0x3 txntype:-1 reqpath:n/a Error Path:/motan/motan-demo-rpc/com.weibo.motan.demo.service.YarService Error:KeeperErrorCode = NoNode for /motan/motan-demo-rpc/com.weibo.motan.demo.service.YarService 2017-10-26 10:05:44,342 - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@651] - Got user-level KeeperException when processing sessionid:0x15f566d40370001 type:create cxid:0x5 zxid:0x4 txntype:-1 reqpath:n/a Error Path:/motan/motan-demo-rpc Error:KeeperErrorCode = NoNode for /motan/motan-demo-rpc 2017-10-26 10:05:44,344 - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@651] - Got user-level KeeperException when processing sessionid:0x15f566d40370001 type:create cxid:0x6 zxid:0x5 txntype:-1 reqpath:n/a Error Path:/motan Error:KeeperErrorCode = NoNode for /motan

sunnights commented 7 years ago

yar协议主要是为了兼容php服务调用,所以并没有为php单独提供服务发现的模块。一般php使用yar协议还是通过7层负载均衡转发。yar协议端口提供了200、503机制,可以用来做服务的动态上下线标识。