微服务启动nacos一直读取本地nacos
时间: 2023-10-13 22:04:37 浏览: 147
在微服务启动时,需要配置Nacos地址以便读取本地Nacos。首先,在微服务的配置文件中(例如application.yml)添加Nacos地址的配置,如下所示:
```
spring:
cloud:
nacos:
server-addr: localhost:8848
```
以上配置将告诉微服务去读取本地的Nacos服务。接下来,重新启动微服务,它将会连接到本地的Nacos,并获取相应的配置信息。这样,微服务就可以通过Nacos来管理和获取配置了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [微服务7 nacos集群搭建](https://blog.csdn.net/m0_62520968/article/details/127182819)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [【微服务】Nacos注册中心](https://blog.csdn.net/zyb18507175502/article/details/126662914)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文