server:
port: 3344
spring:
application:
name: cloud-config-center #注册进Eureka服务器的服务名称
#config的相关配置(注意层级,是在spring下层的)
cloud:
config:
server:
git:
skipSslValidation: true #跳过ssl认证
uri: https://github.com/weifing/springcloud-config.git
search-paths: #搜索目录
- springcloud-config
label: master #读取分支
如上是config的相关配置,配置了远程仓库,启动时,无法启动,报如下的异常:
报错提示:如果配置了git仓库,要添加git uri路径,无法读取到配置的uri。
解决方法:
要在spring.cloud层级下面添加远程仓库uri,更正后的config配置
server:
port: 3344
spring:
application:
name: cloud-config-center #注册进Eureka服务器的服务名称
#config的相关配置(注意层级,是在spring下层的)
cloud:
config:
server:
git:
skipSslValidation: true #跳过ssl认证
uri: https://github.com/weifing/springcloud-config.git
search-paths: #搜索目录
- springcloud-config
label: master #读取分支
#服务注册到eureka地址
eureka:
client:
service-url:
defaultZone: http://eureka7001.com:7001/eureka