浙大 java题库20004,Client 端和 Server 端有一定机率出现 status: 500, error_code: 20004

描述:

使用 zookeeper, motan 的 server 或者 client 在启动的时候有机率报 status: 500, error_code: 20004。 机器上到 Zookeeper 的 IP 是可达的。

日志:

error_message: Create registry false for url:zookeeper://IP:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc, status: 500, error_code: 20004,r=null

com.weibo.api.motan.exception.MotanFrameworkException: error_message: Create registry false for url:zookeeper://IP:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc, status: 500, error_code: 20004,r=null

at com.weibo.api.motan.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:63)

at com.weibo.api.motan.config.handler.SimpleConfigHandler.register(SimpleConfigHandler.java:111)

at com.weibo.api.motan.config.handler.SimpleConfigHandler.export(SimpleConfigHandler.java:80)

at com.weibo.api.motan.config.ServiceConfig.doExport(ServiceConfig.java:211)

at com.weibo.api.motan.config.ServiceConfig.export(ServiceConfig.java:129)

at com.weibo.api.motan.config.springsupport.ServiceConfigBean.onApplicationEvent(ServiceConfigBean.java:96)

at com.weibo.api.motan.config.springsupport.ServiceConfigBean.onApplicationEvent(ServiceConfigBean.java:48)

at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:381)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:335)

at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:855)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)

at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)

at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)

at com.ioneball.main.StartServer.main(StartServer.java:42)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:483)

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 15000

at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880)

at org.I0Itec.zkclient.ZkClient.(ZkClient.java:98)

at org.I0Itec.zkclient.ZkClient.(ZkClient.java:92)

at org.I0Itec.zkclient.ZkClient.(ZkClient.java:80)

at com.weibo.api.motan.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:38)

at com.weibo.api.motan.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:56)

... 21 more

配置:

regProtocol="zookeeper" name="registry" address="${zookeeperIpAndPort}" requestTimeout="15000" connectTimeout="15000" registryRetryPeriod="30000"/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值