-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
service cannot registry to nacos cluster #1728
Comments
service cannot registry to nacos clusterIssue DescriptionI started threee nacos server by cluster mode in windows ,they are 127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868 and started successfully, my application configuration in application.properties is spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868, but the service cannot register to the nacos server and it happend as below: java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance after all servers([127.0.0.1:8848, 127.0.0.1:8858, 127.0.0.1:8868]) tried: failed to req API:http://127.0.0.1:8858/nacos/v1/ns/instance. code:500 msg: java.lang.NullPointerException 2019-08-20 15:21:31.771 INFO 59032 --- [ main] c.i.d.n.p.NacosProviderApplication : Started NacosProviderApplication in 8.484 seconds (JVM running for 36.396) java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/service/list after all servers([127.0.0.1:8848, 127.0.0.1:8858, 127.0.0.1:8868]) tried: failed to req API:http://127.0.0.1:8848/nacos/v1/ns/service/list. code:500 msg: java.net.ConnectException: Connection refused: connect 2019-08-20 15:51:38.304 ERROR 59032 --- [TaskScheduler-1] o.s.c.a.nacos.discovery.NacosWatch : Error watching Nacos Service change Tell us your environmentos is windows 10 Anything else we need to know? |
请参考 #1993 排查,错误信息会在下个版本优化 |
Please use latest version to retry. If still has problem, please open a new issue let us know. |
Issue Description
I started threee nacos server by cluster mode in windows ,they are 127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868 and started successfully, my application configuration in application.properties is spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868, but the service cannot register to the nacos server and it happend as below:
(我在本地使用cluster模式启动了3个nacos server,分别为127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868, 3台nacos server都正常启动了而且集群也成功了。我的服务application.properties中配置如下:
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848,127.0.0.1:8858,127.0.0.1:8868
但是启动的时候报错,服务注册不上去,报错信息如下)
java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance after all servers([127.0.0.1:8848, 127.0.0.1:8858, 127.0.0.1:8868]) tried: failed to req API:http://127.0.0.1:8858/nacos/v1/ns/instance. code:500 msg: java.lang.NullPointerException
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:380) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:304) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.registerService(NamingProxy.java:186) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:298) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:279) ~[nacos-client-1.0.0.jar:na]
at org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:63) ~[spring-cloud-alibaba-nacos-discovery-0.2.2.RELEASE.jar:0.2.2.RELEASE]
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:209) [spring-cloud-commons-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.alibaba.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:74) [spring-cloud-alibaba-nacos-discovery-0.2.2.RELEASE.jar:0.2.2.RELEASE]
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:108) [spring-cloud-commons-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:73) [spring-cloud-commons-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:261) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:180) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:142) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) [spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at com.ibm.demo.nacos.provider.NacosProviderApplication.main(NacosProviderApplication.java:16) [classes/:na]
2019-08-20 15:21:31.771 INFO 59032 --- [ main] c.i.d.n.p.NacosProviderApplication : Started NacosProviderApplication in 8.484 seconds (JVM running for 36.396)
2019-08-20 15:51:05.261 ERROR 59032 --- [TaskScheduler-1] o.s.c.a.nacos.discovery.NacosWatch : Error watching Nacos Service change
java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/service/list after all servers([127.0.0.1:8848, 127.0.0.1:8858, 127.0.0.1:8868]) tried: failed to req API:http://127.0.0.1:8848/nacos/v1/ns/service/list. code:500 msg: java.net.ConnectException: Connection refused: connect
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:380) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:346) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:294) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.getServiceList(NamingProxy.java:276) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.getServiceList(NamingProxy.java:252) ~[nacos-client-1.0.0.jar:na]
at com.alibaba.nacos.client.naming.NacosNamingService.getServicesOfServer(NacosNamingService.java:525) ~[nacos-client-1.0.0.jar:na]
at org.springframework.cloud.alibaba.nacos.discovery.NacosWatch.nacosServicesWatch(NacosWatch.java:127) ~[spring-cloud-alibaba-nacos-discovery-0.2.2.RELEASE.jar:0.2.2.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_181]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]
2019-08-20 15:51:38.304 ERROR 59032 --- [TaskScheduler-1] o.s.c.a.nacos.discovery.NacosWatch : Error watching Nacos Service change
Tell us your environment
os is windows 10
Anything else we need to know?
The text was updated successfully, but these errors were encountered: