linux中服务无法连接至nacos

Blade 未结 1 2231
mmgu
mmgu 2020-08-11 10:58

一、该问题的重现步骤是什么?

1. 完成./deploy.sh base基础模块启动完成

2. 使用blade-admin模块进行验证时,报错连接nacos时connect timed out

3.nacos无异常报错

图片.png



二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

报错日志:

:: SpringBlade :: blade-admin:test :: Running SpringBoot 2.2.5.RELEASE ::

2020-08-11 02:40:29.190  INFO 1 --- [           main] c.a.n.c.c.impl.LocalConfigInfoProcessor  : LOCAL_SNAPSHOT_PATH:/root/nacos/config
2020-08-11 02:40:29.330  INFO 1 --- [           main] c.a.nacos.client.config.impl.Limiter     : limitTime:5.0
2020-08-11 02:40:30.412 ERROR 1 --- [           main] c.a.n.c.config.http.ServerHttpAgent      : [NACOS SocketTimeoutException httpGet] currentServerAddr:http://172.17.0.48:8848锛� err : connect timed out
2020-08-11 02:40:31.414 ERROR 1 --- [           main] c.a.n.c.config.http.ServerHttpAgent      : [NACOS SocketTimeoutException httpGet] currentServerAddr:http://172.17.0.48:8848锛� err : connect timed out
2020-08-11 02:40:32.416 ERROR 1 --- [           main] c.a.n.c.config.http.ServerHttpAgent      : [NACOS SocketTimeoutException httpGet] currentServerAddr:http://172.17.0.48:8848锛� err : connect timed out
2020-08-11 02:40:32.416 ERROR 1 --- [           main] c.a.n.c.config.http.ServerHttpAgent      : no available server
2020-08-11 02:40:32.420 ERROR 1 --- [           main] c.a.n.client.config.impl.ClientWorker    : [fixed-172.17.0.48_8848] [sub-server] get server config exception, dataId=blade, group=DEFAULT_GROUP, tenant=

java.net.ConnectException: no available server
    at com.alibaba.nacos.client.config.http.ServerHttpAgent.httpGet(ServerHttpAgent.java:115) ~[nacos-client-1.1.4.jar!/:na]
    at com.alibaba.nacos.client.config.http.MetricsHttpAgent.httpGet(MetricsHttpAgent.java:48) ~[nacos-client-1.1.4.jar!/:na]
    at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:234) ~[nacos-client-1.1.4.jar!/:na]
    at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:173) [nacos-client-1.1.4.jar!/:na]
    at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:122) [nacos-client-1.1.4.jar!/:na]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:74) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:204) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:191) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadApplicationConfiguration(NacosPropertySourceLocator.java:142) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:103) [spring-cloud-alibaba-nacos-config-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52) [spring-cloud-context-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) [spring-cloud-context-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:101) [spring-cloud-context-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
    at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49) [blade-core-launch-2.6.2.jar!/:na]
    at org.springblade.admin.AdminApplication.main(AdminApplication.java:33) [classes!/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [app.jar:na]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [app.jar:na]

1条回答
  •  smallchill
    smallchill (楼主)
    2020-08-11 15:40

    报错是:java.net.ConnectException: no available server

    说明是无法连接到nacos报的错,查看下admin与nacos的ip是否互通。

    docker logs -f {nacos的容器id} 查看下nacos的日志是否正常

    然后在进入blade-admin容器,执行curl {naocs的api} 看看是否可以正常调用


    0 讨论(0)
提交回复