lamb007 opened a new issue, #11128:
URL: https://github.com/apache/dubbo/issues/11128

   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ## Ask your question here
   使用zookeeper作为注册中心,由于仅仅用作测试,仅使用单机,未做zookeeper集群
   
   在我的电脑上能够正常启动provider和consumer相应的服务
   但在另一台电脑上,clone与我完全相同的代码后,却无法启动服务
   
   这是异常信息:
   `java.lang.RuntimeException: Can not create registry 
service-discovery-registry://xxx.xxx.xxx.xxx:2181/org.apache.dubbo.registry.RegistryService?application=user-provider&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=8312&qos.enable=false&registry=zookeeper&release=3.0.7
        .................................堆栈信息省略
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:307) 
[spring-boot-2.6.11.jar:2.6.11]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) 
[spring-boot-2.6.11.jar:2.6.11]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) 
[spring-boot-2.6.11.jar:2.6.11]
        at 
com.qgexam.user.UserProviderApplication.main(UserProviderApplication.java:13) 
[classes/:na]`
   
   
   `Caused by: java.lang.IllegalStateException: Create zookeeper service 
discovery failed.
        .....................................堆栈信息省略
        ... 35 common frames omitted
   
   Caused by: java.lang.IllegalStateException: failed to connect to zookeeper 
server
        at 
org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkUtils.buildCuratorFramework(CuratorFrameworkUtils.java:75)
 ~[dubbo-3.0.7.jar:3.0.7]
        at 
org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery.<init>(ZookeeperServiceDiscovery.java:72)
 ~[dubbo-3.0.7.jar:3.0.7]
        ... 44 common frames omitted`
   
   这是zookeeper的日志信息:
   `2022-12-13 23:43:35,391 [myid:] - WARN  
[NIOWorkerThread-4:NIOServerCnxn@373] - Close of session 0x10000066bbf003b
   java.io.IOException: Connection reset by peer
           at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
           at sun.nio.ch.IOUtil.read(IOUtil.java:197)
           at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378)
           at 
org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:324)
           at 
org.apache.zookeeper.server.NIOServerCnxnFactory$IOWorkRequest.doWork(NIOServerCnxnFactory.java:522)
           at 
org.apache.zookeeper.server.WorkerService$ScheduledWorkRequest.run(WorkerService.java:154)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:750)
   `
   
   因为代码在我的电脑上能够正常运行,所以我猜测是不是是zookeeper配置的问题?
   这是我的zookeeper配置文件的主要内容
   `
   initLimit=10
   
   syncLimit=5
   
   dataDir=/root/soft/zookeeper/apache-zookeeper-3.6.1-bin/data
   logDir=/root/soft/zookeeper/apache-zookeeper-3.6.1-bin/logs
   
   clientPort=2181
   
   maxClientCnxns=0
   `
   
   这个问题已经困扰了我一天,如果能够得到一些有用的建议,我将万分感激,感谢您能在百忙之中抽出的时间
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to