Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Build a micro-service framework and test environment-10-configuration center

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1 instance

(1) create a server

Create a project using the Filekeeper Newspeak Spring Starter Project and follow the wizard to select config server.

Use the annotation @ EnableConfigServer, as follows:

Modify application.properties:

(2) create a client

Create a project using Fileholders Newspeak Spring Starter Project, and follow the wizard to select config server, web.

Create a controller class and add comments as follows:

Add profile bootstrap.properties:

Modify application.properties:

(3) start and test

Start two services in Boot Dashboard.

Enter the test in the browser:

Because the directory desktop/config is not established in the git library, the solution is to see the C problem below and use the remote repository instead.

Modify the a-bootiful-client.properties file of the remote warehouse to:

Test results:

Further processing is needed at this point to add dependencies to the client project:

Restart the client service and execute on the command line:

If the system does not recognize curl, install the curl tool.

Test client again:

The test was successful.

(4) question:

A. Unable to start client

The reason is that you forgot to select web when you created the project, and the solution is to increase your dependency on spring-boot-starter-web in order to start tomcat:

B 、 No such label: master

Special settings are required to use master branches and other branches

C, Cannot clone or checkout repository: http://localhost:8000/scm/git/config

First, modify the server's application.properties:

Then, store the a-bootiful-client.properties file in the local master branch root directory.

Finally, upload the master remotely to the git server, as instructed in "3.14.3 synchronizing files to the remote repository".

D 、 Cannot load environment

Git status is wrong, restart PC

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report