使用nacos作为注册中心 yml配置
时间: 2023-09-24 09:04:22 浏览: 72
当将 Nacos 作为注册中心时,你可以在 Spring Boot 的 YAML 配置文件中进行相应的配置。以下是一个示例配置:
```yaml
spring:
cloud:
nacos:
discovery:
server-addr: 47.116.116.209:8848 # Nacos 服务地址
registration:
enabled: true # 是否启用 Nacos 注册中心
```
请将上述配置添加到你的 Spring Boot 项目的 YAML 配置文件中,确保替换为正确的 Nacos 服务地址。这样就可以使用 Nacos 作为注册中心进行服务注册和发现了。