spring cloud config 配置自建git服务器


application.yml

server:
  port: 8888

management:
  context-path: /admin
  
logging:
  level:
    com.netflix.discovery: 'OFF'
    org.springframework.cloud: 'DEBUG'
    
eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
    statusPageUrlPath: /admin/info
    healthCheckUrlPath: /admin/health
    hostname: ${CF_INSTANCE_IP:localhost}
    nonSecurePort: ${CF_INSTANCE_PORT:${PORT:${server.port:8888}}}
  client:
    serviceUrl:
      defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/

spring:
  cloud:
    config:
      server:
        overrides:
          eureka:
            client:
              serviceUrl:
                defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
            instance:
              hostname: $\{CF_INSTANCE_IP:localhost}
              nonSecurePort: $\{CF_INSTANCE_PORT:$\{PORT:$\{server.port:8080}}}      
        git:
          uri: <span style="color:#FF0000;">git@127.0.0.1:sample.git</span>
          basedir: target/config

git.properties

git.commit.id.abbrev=92f2e9
git.commit.id=92f2e9e03a9409505ed770276e3f221162ce6633
git.commit.user.name=git
git.build.user.name=git
git.commit.id.describe=92f2e9
git.branch=master
git.remote.origin.url=git@127.0.0.1:sample.git

git服务器 /etc/ssh/sshd_config配置

<pre name="code" class="html">#添加算法
KexAlgorithms diffie-hellman-group1-sha1
KexAlgorithms diffie-hellman-group-exchange-sha1
#只保留rsa key
HostKey /etc/ssh/ssh_host_rsa_key
#开启证书登陆(参考ssh证书登陆)
RSAAuthentication yes
PubkeyAuthentication yes


 


客户端手动登陆一次,产生~/.ssh/known_hosts文件

使用git账户启动spring cloud config 服务器进程。


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值