springboot中的配置服务器问题

时间:2021-03-02 19:06:04

标签: spring-boot spring-cloud spring-cloud-config spring-cloud-config-server

我在配置服务器上遇到问题,在这里,

说明:

无效的配置服务器配置。

操作:

如果您使用的是 git 配置文件,则需要在配置中设置 Git URI。如果您使用本机配置文件并且 spring.cloud.config.server.bootstrap=true,则需要使用复合配置。

我的主要课程:

package com.example.configserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;

@EnableConfigServer
@SpringBootApplication
public class ConfigServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigServerApplication.class, args);
    }

} 我的 bootstrap.properties 文件:

#Server port
server.port = 8981
 
#Git repo location
spring.cloud.config.server.git.uri= D://Learning//Java//config-serve//config-server
 
#Verify any repository issue in service startup
spring.cloud.config.server.git.cloneOnStart=true
 
#Disable security of the Management endpoint
management.security.enabled=false

**config-client.properties file:**
message=Hye Viewers

0 个答案:

没有答案