dubbo客服端连接不上

发布于 2021-11-29 15:19:14 字数 6767 浏览 803 评论 3

server的配置

    <util:properties id="environment" location="classpath:environment.properties" />
    <!-- 提供方应用信息,用于计算依赖关系 -->    
    <dubbo:application name="hello-world-app"  />
 
    <!-- 使用multicast广播注册中心暴露服务地址  ,127.0.0.1:2182,127.0.0.1:2183 -->
   <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181" />
 
    <!-- 用dubbo协议在20880端口暴露服务 -->
    <dubbo:protocol name="dubbo" port="20880" />
   <!--  <dubbo:annotation package="com.sina.fenqi.dobbu" /> -->
   <dubbo:service interface="com.sina.fenqi.dobbu.DemoService" ref="demoService"  />
 
    <!-- 和本地bean一样实现服务 -->
    <bean id="demoService" class="com.sina.fenqi.dobbu.DemoServiceImpl" />    <util:properties id="environment" location="classpath:environment.properties" />
    <!-- 提供方应用信息,用于计算依赖关系 -->    
    <dubbo:application name="hello-world-app"  />
 
    <!-- 使用multicast广播注册中心暴露服务地址  ,127.0.0.1:2182,127.0.0.1:2183 -->
   <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181" />
 
    <!-- 用dubbo协议在20880端口暴露服务 -->
    <dubbo:protocol name="dubbo" port="20880" />
   <!--  <dubbo:annotation package="com.sina.fenqi.dobbu" /> -->
   <dubbo:service interface="com.sina.fenqi.dobbu.DemoService" ref="demoService"  />
 
    <!-- 和本地bean一样实现服务 -->
    <bean id="demoService" class="com.sina.fenqi.dobbu.DemoServiceImpl" />


客服端配置

    <!-- 提供方应用信息,用于计算依赖关系 -->    
    <dubbo:application name="hello-world-app-client"  />
 
    <!-- 使用multicast广播注册中心暴露服务地址 -->
    <!-- <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183"   check="false"/> -->
    <dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"  />
 
    <dubbo:reference id="demoService" interface="com.sina.fenqi.dubbu.DemoService" check="false" />

在dobbuamin的访问控制里面配置 了 192.168.31.242.还是没用



2016-03-11 03:04:12 main  [INFO ] com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry  (AbstractRegistry.java:302) -  [DUBBO] Register: consumer://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=consumers&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, dubbo version: 2.5.3, current host: 192.168.31.242

2016-03-11 03:04:13 main  [INFO ] com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry  (AbstractRegistry.java:325) -  [DUBBO] Subscribe: consumer://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=providers,configurators,routers&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, dubbo version: 2.5.3, current host: 192.168.31.242
2016-03-11 03:04:13 main  [INFO ] com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry  (AbstractRegistry.java:422) -  [DUBBO] Notify urls for subscribe url consumer://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=providers,configurators,routers&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, urls: [empty://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=providers&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, empty://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=configurators&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, empty://192.168.31.242/com.sina.fenqi.dubbu.DemoService?application=hello-world-app-client&category=routers&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743], dubbo version: 2.5.3, current host: 192.168.31.242
2016-03-11 03:04:13 main  [INFO ] com.alibaba.dubbo.config.AbstractConfig  (ReferenceConfig.java:423) -  [DUBBO] Refer dubbo service com.sina.fenqi.dubbu.DemoService from url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=hello-world-app-client&check=false&dubbo=2.5.3&interface=com.sina.fenqi.dubbu.DemoService&methods=sayHello&pid=4965&side=consumer&timestamp=1457636652743, dubbo version: 2.5.3, current host: 192.168.31.242
Exception in thread "main" com.alibaba.dubbo.rpc.RpcException: Forbid consumer 192.168.31.242 access service com.sina.fenqi.dubbu.DemoService from registry 127.0.0.1:2181 use dubbo version 2.5.3, Please check registry access list (whitelist/blacklist).
    at com.alibaba.dubbo.registry.integration.RegistryDirectory.doList(RegistryDirectory.java:579)
    at com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.list(AbstractDirectory.java:73)
    at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.list(AbstractClusterInvoker.java:260)
    at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:219)
    at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72)
    at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
    at com.alibaba.dubbo.common.bytecode.proxy0.sayHello(proxy0.java)
    at org.dubbu.cleint.TestDubbuClient.main(TestDubbuClient.java:15)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

各自安好 2021-12-05 02:31:38

请问是怎么解决的?多谢

疑心病 2021-12-02 21:25:38

防火墙

凌乱心跳 2021-11-30 06:44:12

我也遇到这个问题了,楼主解决了吗?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文