当前位置: 首页 > 知识库问答 >
问题:

spring云配置服务器-无法合并主远程的远程:null

西门嘉石
2023-03-14

我已经使用spring开发了配置服务器。

我的申请书。java是

@EnableConfigServer
@SpringBootApplication

public class SpringConfigServerApplication {

public static void main(String[] args) {
    SpringApplication.run(SpringConfigServerApplication.class, args);
}}

我的bootstrap.properties档案

#Server port
server.port = 8888

#Git repo location
spring.cloud.config.server.git.uri=file://Users/dineth/Documents/MyProjects/sample-git-sources/config-server-repo

我的配置服务器客户端开发。属性文件

msg = Hello world - this is from config server – Development environment.

我使用了git init、git add和git commit命令将我的文件添加到本地git。

但是当我运行应用程序并进入http://localhost:8888/client-config/development

它不显示我的属性值。

// 20200406064430
// http://localhost:8888/client-config/development

{
"name": "client-config",
"profiles": [
"development"
],
"label": null,
"version": "4f989b109d1e6d77c8f44a664b275305ddddf014",
"state": null,
"propertySources": [

]
}

应用程序日志显示:

WARN 2125 --- [nio-8888-exec-2] .c.s.e.MultipleJGitEnvironmentRepository : Could not merge remote for master remote: null

我错过什么了吗?

我在用macOS

共有3个答案

别烨熠
2023-03-14

我也有同样的问题。检查打字错误。在这种情况下,客户端配置/开发应该与本地回购名称相匹配。

欧阳山
2023-03-14

我有同样的“无法合并”错误。我换了我的git让它消失了。网址。

我认为这里的主要问题是在配置服务启动后无法看到您的配置。我通过添加搜索路径属性和正确地形成我的配置回购来解决这个问题。

这是我的配置,在引导中。yml:

spring:
  application:
    name: config-service
  cloud:
    config:
      server:
        git:
          # Spring redefines ${variable} to be @variable@ for maven vars as it uses ${...} for itself
          uri: @project.basedir@/../config-repo
          #uri: ${user.home}\projects\java\prototype0\config-repo # works
          #uri: C:\Users\myuser\projects\java\prototype0\config-repo # works
          #uri: file:///C:\Users\myuser\projects\java\prototype0\config-repo # works, but gives Could not merge error
          #uri: file:///C:/Users/myuser/projects/java/prototype0/config-repo # works, but gives Could not merge error
          basedir: config_repo
          clone-on-start: true
          search-paths: '{application}'

我的配置回购的结构如下:

$ find config-repo/ | grep -v git
config-repo/
config-repo/admin-service
config-repo/admin-service/admin-service-dev.yml
config-repo/eureka-service
config-repo/eureka-service/eureka-service-dev.yml
config-repo/gateway-service
config-repo/gateway-service/gateway-service-dev.yml
config-repo/resource1-service
config-repo/resource1-service/resource1-service-dev.yml

找到的配置:

$ curl http://localhost:8762/eureka-service/dev | jq

{
  "name": "eureka-service",
  "profiles": [
    "dev"
  ],
  "label": null,
  "version": "4fb2d62fe542d8f2c73ae422d5266874cbfc779a",
  "state": null,
  "propertySources": [
    {
      "name": "C:/Users/myuser/projects/java/prototype0/config-service/../config-repo/eureka-service/eureka-service-dev.yml",
      "source": {
        "management.endpoints.web.exposure.include": "*",
        "management.endpoint.health.show-details": "ALWAYS"
      }
    }
  ]
}
南门飞扬
2023-03-14

在您的情况下,将git repo指向本地目录时,需要使用本机配置文件运行Config Serverfile://Users/dineth/Documents/MyProjects/sample-git-sources/config-server-repo

只需将以下行添加到配置服务器application.properties:

spring.profiles.active=native
 类似资料:
  • 我正在尝试设置一个SpringCloudConfig服务器,它使用SSH密钥从GitRepo获取配置。它使用SpringBootVersion2.1运行。0.0版本和springCloudVersion格林威治。M3。 当在下面的配置中使用带有用户名和密码的https bitbucket URI时,配置服务工作正常,没有问题: 但我们必须迁移到使用ssh密钥,而不是使用以下配置的用户名和密码: i

  • 本文向大家介绍pycharm远程连接服务器并配置python interpreter的方法,包括了pycharm远程连接服务器并配置python interpreter的方法的使用技巧和注意事项,需要的朋友参考一下 背景 远程服务器是Ubuntu系统,操作中可以使用pycharm在windows或者Ubuntu系统上编辑代码并调试,但是首先需要professional版本的pycharm,comm

  • 本文向大家介绍mac 上配置Pycharm连接远程服务器并实现使用远程服务器Python解释器的方法,包括了mac 上配置Pycharm连接远程服务器并实现使用远程服务器Python解释器的方法的使用技巧和注意事项,需要的朋友参考一下 本文将介绍如何使用公司运行服务器进行开发调试,以及使用远程服务器python解释器,整理了对应的配置流程。 进入配置页面 Pycharm菜单栏,如下图所示,依次点击

  • 我开始查看firebase remote config,阅读了文档并创建了一个简单的测试应用程序来了解缓存是如何工作的,但我不清楚其行为。 为了标识当前的应用程序实例,fetch请求创建一个Firebase实例ID令牌,该令牌定期向Firebase后端发送数据 在每次新的调用时,都会创建一个新的ID?期刊的要求是如何工作的?我希望只调用一次fetch,并且在请求过时的属性值或类似的东西时自动发送请

  • 我无法连接到在Windows上的远程机器上运行的mongob服务器,我通过命令提示符(不是服务)上的远程桌面连接进行远程访问,在远程机器上启动mongob服务器,它显示在端口27017上等待连接... 我也尝试过创办蒙古包bind_ip0.0.0.0,但没有任何益处。 我还检查了远程机器上的端口27017是通过UDP打开的,而不是通过[https://support.nightlydev.org/

  • sudo ufw状态:活动状态 从---------22/TCP允许任意位置10000 允许任意位置Nginx完全 允许任意位置3333 允许任意位置27017 允许任意位置22/TCP(v6) 允许任意位置(v6)10000(v6) 允许任意位置(v6)Nginx完全(v6) 允许任意位置(v6)27017(v6) 允许任意位置(v6) 从我的mac连接到它会引发错误: mongo MongoD