在学习电商项目时,一开始我是在宿舍学写的项目。![这里是我写的provider](https://img-blog.csdnimg.cn/20191101213448146.png)
前三个项目是在宿舍写的,然后第四个是在课室写的,当时插了网线(所以是换了ip地址的问题???)。
然后在启动dubbo服务,运行comsumer时,![在这里插入图片描述](https://img-blog.csdnimg.cn/20191101213707803.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwMzk2NjUx,size_16,color_FFFFFF,t_70)
这时出现错误
com.alibaba.dubbo.config.spring.AnnotationBean 2019-11-01 08:27:28 [DUBBO] Failed to init remote service reference at filed tbItemParamServiceImpl in class com.ego.manage.service.impl.TbItemParamServiceImpl, cause: Failed to check the status of the service com.ego.manage.service.TbItemParamService. No provider available for the service com.ego.manage.service.TbItemParamService from the url zookeeper://192.168.140.133:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-manage&dubbo=2.5.3&interface=com.ego.manage.service.TbItemParamService&methods=show&pid=3364&side=consumer×tamp=1572611247985 to the consumer 192.168.140.1 use dubbo version 2.5.3, dubbo version: 2.5.3, current host: 192.168.140.1
java.lang.IllegalStateException: Failed to check the status of the service com.ego.manage.service.TbItemParamService. No provider available for the service com.ego.manage.service.TbItemParamService from the url zookeeper://192.168.140.133:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-manage&dubbo=2.5.3&interface=com.ego.manage.service.TbItemParamService&method
然后我上dubbo的admin页面发现在课室新写的TbItemParamDubboServiceImpl【provider】写着没有消费者,而consumer项目写着没有提供者。
上网看了一些文章,是因为换了ip地址,然后provider向zookeeper发布服务时,ip变了?即服务提供者provider的ip变了,所以消费方consumer拿不到provider的ip
后面我把新写的项目删除后,在宿舍再重写,就ok了
看网上说把vmare的虚拟网卡关了,在网络适配器关了,但我关了后,xshell远程连接不上linux。