![](/img/trans.png)
[英]spring cloud config server reading only from master branch
[英]Spring Cloud Config Server: error: No such label: master
當我訪問 url http://localhost:8888/actuator/health 時出現此錯誤
{
"status": "DOWN",
"details": {
"diskSpace": {
"status": "UP",
"details": {
"total": 457192763392,
"free": 347865096192,
"threshold": 10485760
}
},
"refreshScope": {
"status": "UP"
},
"configServer": {
"status": "DOWN",
"details": {
"repository": {
"application": "app",
"profiles": "default"
},
"error": "org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: master"
}
}
}
}
我的應用程序.yml
我遇到了同樣的問題,並通過進行以下兩項更改解決了這個問題:
spring.cloud.config.server.git.uri=E:/spring_microservice/git-localconfig-repo
到處都添加了正斜杠 ( /
)。
您可以簡單地在配置文件 application.properties 或 apllication.yml 中添加以下代碼行:
- 對於使用 application.properties 文件的人:
spring.cloud.config.server.git.default-label=main
- 對於使用 application.use 文件的人:
彈簧:雲:配置:服務器:git:默認標簽:主
檢查您的屬性文件名和請求文件名。 我得到了相同的結果並解決了以下兩個更改。
第一次更改: spring.cloud.config.server.git.uri=E:\\\\\\\\spring_microservice\\\\\\\\git-localconfig-repo
刪除了文件///......並添加了 4 個斜杠 (\\\\)
第二次更改:實際上我正在使用不正確的屬性文件名提出請求。 我正在發出類似http://localhost:8888/limit-servers/default
的請求,但正確的文件名是limit-server.properties
所以我已經更正了如下請求。
http://localhost:8888/limit-server/default
它對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.