dubbo客服端连接不上

鸟菜啊 发布于 2016/03/11 03:08
阅读 3K+
收藏 0

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)
加载中
0
g
gm100861
我也遇到这个问题了,楼主解决了吗?
0
李风奎

请问是怎么解决的?多谢

返回顶部
顶部