当前位置:网站首页>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
边栏推荐
- D39_ coordinate transformation
- 原生JS带你了解数组方法实现及使用
- 错误记录集锦(遇到则记下)
- The use of three parameters of ref, out, and Params in Unity3D
- Take you in-depth understanding of cookies
- vs2017关于函数命名方面的注意事项
- 记录vue-页面缓存问题
- config.js相关配置汇总
- The cocos interview answers you are looking for are all here!
- 干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站
猜你喜欢

LeetCode practice and self-comprehension record (1)

From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture

el-progress implements different colors of the progress bar

人人AI(吴恩达系列)

Nacos集群的搭建过程详解

input detailed file upload

邮件管理 过滤邮件

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

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

滚动条问题,未解决
随机推荐
Met with the browser page
Wireshark packet capture and common filtering methods
Detailed explanation of ten solutions across domains (summary)
Drools规则引擎快速入门(一)
vscode笔记
el-autocomplete use
多线程之传递参数
Network Troubleshooting Basics - Study Notes
请问下通过flink sql读取hologres 的两张表的 binlog,然后如何进行join?
跨域的十种解决方案详解(总结)
获取预训练模型的网络输入尺寸
DevOps process demo (practical record)
product learning materials
selenium学习
The method of using ROS1 bag under ROS2
ALC experiment
Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
D45_Camera assembly Camera
Collection of error records (write down when you encounter them)
[问题已处理]-jenkins流水线checkout超时