springboot2.2.8中將配置文件中的nacos地址改為遠(yuǎn)程地址后啟動(dòng)時(shí)仍然連接localhost
2020-07-18 14:03:55.538 ERROR 7212 --- [-localhost_8848] c.a.n.c.config.http.ServerHttpAgent : [NACOS ConnectException httpPost] currentServerAddr: http://localhost:8848, err : Connection refused: connect
2020-07-18 14:03:57.543 ERROR 7212 --- [-localhost_8848] c.a.n.c.config.http.ServerHttpAgent : [NACOS ConnectException httpPost] currentServerAddr: http://localhost:8848, err : Connection refused: connect
2020-07-18 14:03:59.545 ERROR 7212 --- [-localhost_8848] c.a.n.c.config.http.ServerHttpAgent : [NACOS ConnectException httpPost] currentServerAddr: http://localhost:8848, err : Connection refused: connect
2020-07-18 14:04:01.559 ERROR 7212 --- [-localhost_8848] c.a.n.c.config.http.ServerHttpAgent : [NACOS ConnectException httpPost] currentServerAddr: http://localhost:8848, err : Connection refused: connect
2020-07-18 14:04:01.559 ERROR 7212 --- [-localhost_8848] c.a.n.client.config.impl.ClientWorker : [fixed-localhost_8848] [check-update] get changed dataId exception
java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached
解決方案
在resources目錄下創(chuàng)建bootstrap.properties配置文件凉翻,將nacos相關(guān)配置寫在該文件中即可