8.【Spring Cloud Alibaba】配置管理-Nacos
使用Nacos管理配置
架构图
配置文件遵循的格式 bootstrap.yml
pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
bootstrap.yml
spring:
cloud:
nacos:
config:
server-addr: localhost:8848
file-extension: yaml
application:
name: content-center
profiles:
active: dev
content-center-dev.yaml
nacos:
config: okkkkkkk
配置属性动态刷新与回滚
@RefreshScope
应用的配置共享
引导上下文(applicationContext父上下文)
数据持久化
搭建生产可用的nacos集群
配置最佳实践总结
欢迎关注微信或公众号!!!
![](https://images.cnblogs.com/cnblogs_com/xjknight/1468828/o_20180906094155.jpg)
![](https://images.cnblogs.com/cnblogs_com/xjknight/1468828/o_qrcode_for_gh_abda17964e3d_258.jpg)
PS:如果你觉得文章对你有所帮助,别忘了推荐或者分享,因为有你的支持,才是我续写下篇的动力和源泉!
出处: https://www.cnblogs.com/xjknight/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。