Spring Cloud config server

Source: Internet
Author: User
Tags file url

The server provides resource-based HTTP for external configuration (name-value pairs or equivalent yaml content). The server can be @EnableConfigServer easily embedded in the spring boot application using annotations. So this application is a configuration server:


@SpringBootApplication @enableconfigserver  Public class Configserver {  publicstaticvoid  main (string[] args) {    Springapplication.run (configserver. class , args);}  }

Like all spring boot applications running on the default port 8080, you can switch them to regular port 8888 in a variety of ways. The simplest is also to set a default configuration library, which is done by starting it spring.config.name=configserver (there is one in the Config Server jar configserver.yml ). The other is to use your own application.properties , for example

8888 Spring.cloud.config.server.git.uri:file: // ${user.home}/config-repo
which ${user.home}/config-repois a git repository that contains Yaml and properties files. In Windows, if the file URL is an absolute drive prefix, for example file:///${user.home}/config-repo, additional "/" is required.
here's how to create a git repository in the example above: CD $HOME $ mkdir config-repo$ cd config->-"  Add application.properties"

It is interesting to add Penguin 1903832579, using a local file system for the GIT repository for testing only. Use the server to host the configuration library in a production environment. If you keep only text files, the initial cloning of the configuration library will be quick and efficient. If you start to store binaries, especially large files, you may experience a delay in the first configuration request and/or out-of-memory error in the server.

Spring Cloud config server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.