报错如下:172.16.238.68是我的本机ip
[DUBBO] Failed to start NettyClient TS20160418002/172.16.234.102 connect to the server /172.16.238.68:20880 (check == false, ignore and retry later!), cause: client(url:dubbo://172.16.238.68:20880/com.tuhu.future.dubbo.service.DubboInterface?actives=0&anyhost=true&application=provider-test&async=false&check=false&codec=dubbo&dubbo=2.5.7&generic=false&group=test&heartbeat=60000&interface=com.tuhu.future.dubbo.service.DubboInterface&lazy=false&methods=getAllRecords,sayOk,getUserRecord,getNmae&pid=6872®ister.ip=172.16.234.102&remote.timestamp=1531879689779&revision=1.0.0&sent=false&side=consumer×tamp=1531879711858&version=1.0.0) failed to connect to server /172.16.238.68:20880, error message is:connection timed out: /172.16.238.68:20880, dubbo version: 2.5.7, current host: 172.16.234.102
–情况实际是:我本机启动生产方和消费方没有问题,测试dubbo服务正常,但是别的机器电脑A作为消费方去调用我的生产者服务时,出现以上启动异常。
解决办法:
1.电脑A上去ping 我的ip,能否通过,不能通过的话即两台机器之间不在同一网络下所以问题的根源不在dubbo的配置上,只需要处于同一网络环境下,那么就能避免这个问题;如果是在同一个网络下可能是防火墙问题
2.解决方法:将生产方的防火墙关闭
参考解决:dubbo报错