[英]Spring Cloud config server fails to start
我正在關注 application.properties 中的條目
spring.application.name=spring-cloud-config-server
server.port=8888
#spring.cloud.config.server.git.uri:file:///C:/software/codebase/microservices/git-localconfig-repo
spring.cloud.config.server.git.uri:https://github.com/XYZ/limits-service
spring.cloud.config.server.git.uri.username=test
spring.cloud.config.server.git.uri.password=test
我有 spring 雲服務器應用程序的以下代碼。
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableConfigServer
@SpringBootApplication
@EnableAutoConfiguration
public class SpringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringConfigServerApplication.class, args);
}
}
我收到以下錯誤
啟動 ApplicationContext 時出錯。 要顯示條件報告,請在啟用“調試”的情況下重新運行您的應用程序。 2021-02-24 01:39:52.356 錯誤 20804 --- [restartedMain] osbdLoggingFailureAnalysisReporter:
應用程序無法啟動
描述:
配置服務器配置無效。
行動:
如果您使用 git 配置文件,則需要在配置中設置 Git URI。 如果您使用的是本機配置文件並且具有 spring.cloud.config.server.bootstrap=true,則需要使用復合配置。
在這一行應該是一個等於:
spring.cloud.config.server.git.uri=https://github.com/XYZ/limits-service
代替
spring.cloud.config.server.git.uri:https://github.com/XYZ/limits-service
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.