小编pip*_*per的帖子

Spring Cloud Config Server - MultipleJGitEnvironmentRepository:无法为主远程获取远程

我正在尝试设置一个 spring 云配置服务器,它使用 SSH 密钥从 git 存储库中获取配置。它与 springBootVersion 2.1.0.RELEASE 和 springCloudVersion Greenwich.M3 一起运行。

当使用带有用户名和密码的 https bitbucket URI 和以下配置时,配置服务工作正常,没有问题:

  security.user:
    name: xxxxx
    password: xxxxx
  cloud.config.server:
    git:
      uri: https://bitbucket.org/abc/configs.git
      username: uname
      password: pass
Run Code Online (Sandbox Code Playgroud)

但是我们必须迁移以使用 ssh 密钥而不是具有以下配置的用户名和密码:

  security.user:
    name: xxxxx
    password: xxxxx
  cloud.config.server:
    git:
      uri: git@bitbucket.org:abc/configs.git
Run Code Online (Sandbox Code Playgroud)

id_rsa 私钥文件与配置文件位于 .ssh 文件夹中:

Host bitbucket.org
    StrictHostKeyChecking no
    IdentityFile /home/user/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)

最初的 git clone 工作正常,当我点击 时,我们能够毫无问题地获取配置http://xxxx:xxxx@localhost:8899/app/dev

但在那之后,日志中有很多 WARN 无法从远程获取。在初始克隆之后,还可以正确获取对配置的进一步更新。但不知道为什么日志中有这么多警告,这让我很担心。

2020-07-31 11:38:51.636 WARN 1 --- [io-48899-exec-7] .cseMultipleJGitEnvironmentRepository:无法为主远程获取远程:git@bitbucket.org:abc/configs.git

正如我之前提到的,这只会在我们使用 SSH 密钥进行克隆时发生。同一个项目与 https 克隆一起工作正常。有什么我想念的吗?

git ssh bitbucket ssh-keys spring-cloud-config

4
推荐指数
1
解决办法
1627
查看次数

标签 统计

bitbucket ×1

git ×1

spring-cloud-config ×1

ssh ×1

ssh-keys ×1