当前位置:网站首页>[step on the pit] Nacos registration has been connected to localhost:8848, no available server

[step on the pit] Nacos registration has been connected to localhost:8848, no available server

2022-07-07 08:41:00 Dream and sea depth @ none

Today, I found a problem when sorting out Alibaba's wechat , Error reported at startup no available server, Then I found that I had been connected localhost:8848, But in my configuration, there are other configured addresses , Not started locally nacos, The specific error information is shown in the figure
 Insert picture description here
Baidu has found many ways , what nacos The dependent version of ,nacos Of discovery and config If dependence exists , Configuration must also be configured , Or join nacos-client rely on , Or join bootstrap And so on , There is no misuse , Then I suddenly found a problem , My profile name is application.yaml, And in the configuration file ,bootstrap The priority of the configuration file is higher than application Of , Could it be springboot Priority to load bootstrap The configuration file , And then we use springboot embedded bootstarp The configuration file , It's equipped with localhost:8848 This address , This causes the service to connect all the time localhost,no available server, And then I put The name of the configuration file is changed to bootstrap.yaml, Problem solving !

原网站

版权声明
本文为[Dream and sea depth @ none]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070556099299.html