SpringCloud使用 Nacos做注册中心 客户端启动报错 java.lang.IllegalArgumentException: no server available at com.a...

java.lang.IllegalArgumentException: no server available at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI的解决方案

SpringCloud 版本是 Hoxton.SR6

首先看看总依赖springcloud Alibaba 版本号是:

com.alibaba.cloudspring-cloud-alibaba-dependencies2.1.0.RELEASEpomimport

以上配置报错 no server available 没有可用的服务器

nacos registry, cloud-user-service register failed…NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr=’’, endpoint=’’, namespace=’’, watchDelay=30000, logName=’’, service=‘cloud-user-service’, weight=1.0, clusterName=‘DEFAULT’, namingLoadCacheAtStart=‘false’, metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip=‘192.168.109.1’, networkInterface=’’, port=8001, secure=false, accessKey=’’, secretKey=’’}},

java.lang.IllegalArgumentException:noserveravailableatcom.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:438)~[nacos-client-1.1.1.jar:na]atcom.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386)~[nacos-client-1.1.1.jar:na]atcom.alibaba.nacos.client.naming.net.NamingProxy.registerService(NamingProxy.java:188)~[nacos-client-1.1.1.jar:na]atcom.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:205)~[nacos-client-1.1.1.jar:na]atcom.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:184)~[nacos-client-1.1.1.jar:na]atcom.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:61)~[spring-cloud-alibaba-nacos-discovery-2.1.0.RELEASE.jar:2.1.0.RELEASE]atorg.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:239)[spring-cloud-commons-2.2.2.RELEASE.jar:2.2.2.RELEASE]atcom.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:74)[spring-cloud-alibaba-nacos-discovery-2.1.0.RELEASE.jar:2.1.0.RELEASE]atorg.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:138)[spring-cloud-commons-2.2.2.RELEASE.jar:2.2.2.RELEASE]atorg.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:101)[spring-cloud-commons-2.2.2.RELEASE.jar:2.2.2.RELEASE]atorg.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:88)[spring-cloud-commons-2.2.2.RELEASE.jar:2.2.2.RELEASE]atorg.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)[spring-cloud-commons-2.2.2.RELEASE.jar:2.2.2.RELEASE]atorg.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:165)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:315)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1226)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1215)[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]atcom.wuyou.springcloud.UserService.main(UserService.java:11)[classes/:na]

根据 SpringCloud Alibaba 的github的版本说明 H版本的Springcloud推荐使用Spring Cloud Alibaba Version 2.2.0.RELEASE

链接:https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明

把总依赖的服务的版本改为:2.2.0.RELEASE

成功启动!!!

Nacos的管理界面:localhostL:8848/nacos 默认用户名密码都是 nacos

解决思路转载于:https://blog.csdn.net/wuyou_1997/article/details/105458503

金融融融融果果

关注 - 3

粉丝 - 1

+加关注

0

0

« 上一篇: SpringCloud:gateway网关模块启动报错

» 下一篇: 前端-ES6

posted @ 2020-07-03 16:03 金融融融融果果阅读(278)  评论(0) 编辑 收藏

刷新评论刷新页面返回顶部

你可能感兴趣的:(SpringCloud使用 Nacos做注册中心 客户端启动报错 java.lang.IllegalArgumentException: no server available at com.a...)