1 导包
代码语言:javascript复制implementation 'org.springframework.cloud:spring-cloud-config-server'
2 配置文件
代码语言:javascript复制server:
port: 8203
spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: git@47.222.222.222:/srv/ads-config.git # 配置git仓库的地址
username: git # git仓库的账号
password: epnc # git仓库的密码
rabbitmq:
host: 88.88.88.88
port: 5672
username: root
password: 9710222222224
management: ##开启刷新配置 client也要加配置
endpoints:
web:
exposure:
exclude: "*"
eureka:
client:
service-url:
defaultZone: http://4.1.22.22:8200/eureka/
3 注意
上传到远程服务器后,需要先在远程服务器测试git clone命令