In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to configure the springcloud configuration center native. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Spring cloud configuration center native configuration 1, pom file add dependency org.springframework.cloud spring-cloud-config-server2, configuration file application.properties configure local path # tomcat port number server.port=8001# configuration file in the local spring.profiles.active=native# configuration file directory spring.cloud.config.server.native.search-locations=D:/workspace/GitHub/spring-config/config-file3, The main program opens @ EnableConfigServer annotation @ EnableConfigServer@SpringBootApplicationpublic class ConfigApplication {public static void main (String [] args) {SpringApplication.run (ConfigApplication.class) Args) }} spring config server uses native
Using spring cloud's config server, store a default configuration file in config server, which is located in the resouces of the application and located in resource/shared, and will be released with the config server package.
In the location where a file system is appended, custom configuration information can be stored in this location. After the system is deployed, the custom configuration file config server provides configuration service yml files in the agreed folder, in which application.yml will provide configuration parameters to all config client and then there is a specific application configuration file appname.yml. Each system has two configuration files, plus two configuration file storage locations.
Therefore, the configuration file of a system will load four yml files and among the four yml configuration files, the configuration files with high priority will overwrite the configuration files with low priority. If the client of config is park-auth, the corresponding configuration files are (configuration items arranged from high priority to low priority):
Native configuration of / var/park/conf/park-auth.ymlclasspath:/shared/park-auth.yml/var/park/conf/application.ymlclasspath:/shared/application.ymlconfig server
The high priority configuration is as follows: cloud: config: server: native: search-locations:-classpath:/shared-/ var/park/conf
This is the end of this article on "how to configure springcloud configuration Center native". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.