当前位置:网站首页>NACOS Configuration Center Settings Profile
NACOS Configuration Center Settings Profile
2022-08-05 06:45:00 【User Nickname 23】
Add a new configuration in the nacos configuration center
After logging in to nacos, click the plus sign in the configuration list
Edit configuration information submission
Note the naming rules of Data ID
${prefix}-${spring.profile.active}.${file-extension}- The prefix defaults to the value of spring.application.name of the project configuration (ie: nacos-provider),It can also be configured through the configuration item spring.cloud.nacos.config.prefix.- spring.profiles.active=dev is the profile corresponding to the current environment.Note: When spring.profiles.active is empty,The corresponding connector - will also not exist, and the concatenation format of dataId becomes ${prefix}.${file-extension}- file-exetension is the data format of the configuration content, which can be configured through the configuration item spring.cloud.nacos.config.fileextension.Currently only properties and yaml types are supported.Select the corresponding suffix according to your local configuration file type
Paste the corresponding configuration information and click Publish
The loading order of the springboot configuration file
This mainly describes the loading order of application and bootstrap.
bootstrap.yml (bootstrap.properties) loads
application.yml (application.properties) first
bootstrap.yml is used for the bootstrap phase of the application context.
bootstrap.yml is loaded by the parent Spring ApplicationContext.The parent ApplicationContext is loaded before using application.yml.
(2) Configuration difference Both bootstrap.yml and application.yml can be used to configure parameters.
bootstrap.yml can be understood as some parameter configurations at the system level, these parameters generally do not change.
application.yml can be used to define application level.
We use the bootstrap.yml configuration file in our project
#Configuration center addressspring:cloud:nacos:config:server-addr: 127.0.0.1:8848#spring.profiles.active=dev# This configuration affects the dataId in the unified configuration centerapplication:name:service-statistics# Namespaces#spring.cloud.nacos.config.namespace=8c7d4e34-09df-405f-a351-50fa42285a7fNote that if bootstrap.yml is used locally, the configuration file in nacos must also be of the type yml or it will not be loaded. Similarly, if it is bootstrap.properties, the configuration file in nacos must also be properties or it will not be loaded.Load to, according to the suffix of dataId and the selection in the new configuration
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 设置文本向两边居中展示
- Will intelligent operation and maintenance replace manual operation and maintenance?
- NB-IOT智能云家具项目系列实站
- selenium模块的操作之拉钩
- flink cdc 目前支持Gauss数据库源吗
- 深夜小酌,50道经典SQL题,真香~
- [Problem has been resolved]-Virtual machine error contains a file system with errors check forced
- Wireshark packet capture and common filtering methods
- 多线程之传递参数
- el-progress实现进度条颜色不同
猜你喜欢

disabledDate 日期选择器 datePicker

Teach you simple steps to achieve industrial raspberries pie properly installed RS232 USB drive

Cloud Computing Basics - Study Notes

Dry!Teach you to use industrial raspberries pie combining CODESYS configuration EtherCAT master station

Drools规则引擎快速入门(一)

NB-IOT智能云家具项目系列实站

The future of cloud gaming

One-arm routing experiment and three-layer switch experiment

多行文本省略

sql server 重复值在后面计数
随机推荐
【考研结束第一天,过于空虚,想对自己进行总结一下】
transport layer protocol
Alibaba Cloud Video on Demand
The cocos interview answers you are looking for are all here!
媒体查询、rem移动端适配
Collision, character controller, Cloth components (cloth), joints in the Unity physics engine
Network Protocol Fundamentals - Study Notes
numpy.random使用文档
Mina disconnects and reconnects
DevOps process demo (practical record)
LaTeX笔记
H5 的浏览器存储
sql server 重复值在后面计数
NB-IOT智能云家具项目系列实站
LeetCode中常用语言的一些基本方法记录
Transformer interprets and predicts instance records in detail
多行文本省略
LeetCode practice and self-comprehension record (1)
product learning materials
Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images