内容简介:使用bootstrap然后定义好扩展名,因为在nacos里我们添加的是yaml文件,,只它默认只查询 properties文件bootstrap.ymlbootstrap-dev.yml
配置文件问题
如果使用application命名时,需要使用 Properties 扩展名的,如果使用 yml 格式的,那你不能使用application.yml,而应该使用bootstrap.yml这种格式,如图所示,这种是无法加载配置的
使用bootstrap然后定义好扩展名,因为在nacos里我们添加的是yaml文件,,只它默认只查询 properties文件
bootstrap.yml
server.port: 6060 spring: application.name: gateway profiles.active: dev
bootstrap-dev.yml
spring:
cloud:
nacos:
config:
server-addr: 127.0.0.1:8848
file-extension: yaml
discovery:
server-addr: 127.0.0.1:8848
对于nacos上的配置文件,是可以没有扩展名的
总结 :在使用yaml配置文件时,我们需要使用bootstrap做为本地配置文件的名称。
以上所述就是小编给大家介绍的《springcloud~nacos在使用中需要注意的问题》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- 建设私有云需要注意哪些问题?
- JavaScript正则需要注意的地方
- 工业4.0转型升级需要注意哪些问题?
- Kubernetes使用时需要注意的坑点
- Android 相机预览需要注意的几点
- 推进项目上线,你需要注意以下几点
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Introduction to Computation and Programming Using Python
John V. Guttag / The MIT Press / 2013-7 / USD 25.00
This book introduces students with little or no prior programming experience to the art of computational problem solving using Python and various Python libraries, including PyLab. It provides student......一起来看看 《Introduction to Computation and Programming Using Python》 这本书的介绍吧!