我们现在使用spring cloud config 远程连接github会存在网络跟不上问题,以及本地git密钥问题。
1.github更改了密钥策略原来生成的rsa会导致报错,需要使用命令重新生成ed25519密钥2.配置需要按照上述配置
force-pull: true #这个参数不加可能会有网络导致连接不上
将工程注册到eureka,需要自助构建项目。
org.springframework.cloud spring-cloud-config-server org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-devtools runtime true org.projectlombok lombok true org.springframework.boot spring-boot-starter-test test
server:port: 3344spring:application:name: cloud-config-center #注册进Eureka服务器的微服务名cloud:config:server:git:uri: https://github.com/****/springcloud2023.git #GitHub上面的git仓库名字
# username: account #私有仓库才需要账号密码
# password: passwordsearch-paths: ####搜索目录- springcloud-configforce-pull: true #
# ignore-local-ssh-settings: trueskip-ssl-validation: true####读取分支label: main
#服务注册到eureka地址
eureka:client:service-url:defaultZone: http://localhost:7001/eureka
本地浏览器访问:http://localhost:3344/main/config-dev.yml
上一篇:如何通过限流算法防止系统过载