问题标签 [spring-cloud-config]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 从文件或服务器动态配置spring cloud config
我正在开发一个应用程序并想使用 spring-cloud-config。我的应用程序经历了大规模的回归测试,我不想为每个测试启动(或嵌入我的应用程序)spring-cloud-config-server。我想要做的是有一个本地配置文件,应用程序将在spring的引导阶段之前读取它,然后根据它设置配置服务器的uri或从本地文件中读取它的路径在本地conf文件中.
最好的方法是什么?
谢谢
jwt - JHipster Registry 拒绝网关和微服务
我正在尝试将 JHipster 用于使用微服务的项目,但最新的 JHipster Registry 不会让我的网关或微服务访问配置服务器并拒绝它们。
我安装了 JHipster Vagrant DevBox,然后用来docker run -p 8761:8761 jhipster/jhipster-registry
运行 JHipster 注册表。然后,我在此之后生成了一个网关和 2 个微服务,并且它起作用了。
但是后来我想使用来自 GitHub 的 JHipster Registry,所以我克隆了它并运行了它(显然它同时已更新到 2.0.0)。遗憾的是,网关和微服务无法访问此注册表。不过,他们仍然能够访问 Docker 镜像注册表(我想 Docker 没有更新它)。但由于它更漂亮,而且可能更新,我想使用最新版本的注册表,与 GitHub 上的相同。所以我尝试用docker pull
. 现在它不适用于任何一个注册表——Docker 镜像或 GitHub 克隆。
当注册表正在运行并且我运行网关或微服务时,我得到了 6 倍:
然后我得到一个错误:
然后我得到Java异常:
最后是BUILD FAILURE
一个 Maven 错误:
在注册表的外壳中,我也得到了这条线 6 次:
我尝试更新所有内容,并且目前正在尝试降级(因为文档说“我们建议您使用与用于 JHipster 生成器的版本相同的版本标签”,但我认为它不会在 JHipster 之后工作Registry 的最新版本是 2.0.0,JHipster 生成器在 3.0 版本中引入了微服务),我也尝试直接从 central-server-config 复制秘密到应用程序的配置,但显然无济于事。
你能帮我解决这个问题吗?
非常感谢您提前。
编辑:
我尝试使用 将 JHipster 更新到 3.2.1 npm install -g generator-jhipster
,这显然有效,但是当我运行时yo jhipster
,Yeoman 仍然使用 JHipster 3.1.0。实际上,即使我用 卸载 JHipster npm uninstall -g generator-jhipster
,Yeoman 仍然可以使用 JHipster 3.1.0...
编辑:
如果我在本地重新安装所有东西(在我使用的目录中yo jhipster
),它工作正常。但是,我仍然无法在 Yeoman 中全局更新 JHipster。当我尝试使用npm install -g generator-jhipster
时,它会将 JHipster 全局更新为 3.2.1,但 Yeoman 仍然使用 3.1.0。如果我尝试使用yo
/"Update your generators"/generator-jhipster 更新 JHipster,我会收到错误消息:
当我尝试运行时,使用sudo
会做同样的事情并给我这个:sudo su
yo
编辑:
好的,即使使用本地安装它也不起作用...网关确实可以访问注册表,但是当我尝试访问 localhost:8080 时它会显示一个调试页面。实际上,在生成过程中,我permission denied
又得到了一个,并且缺少依赖项(gulp-rev
)。
我刚刚看到这个:“使用标签拥有稳定版本是明智的:JHipster DevBox标签与JHipster Generator标签相同,因此使用DevBox v3.2.0也意味着使用生成器v3.2.0”上DevBox GitHub页面,所以也许我会删除并再次下载DevBox......
spring - Spring Cloud Config + Spring Cloud Bus + RabbitMQ - 不使用本地 Git 存储库自动刷新客户端
我有一些应用程序从 Spring Cloud Config Server ( Brixton.RELEASE ) 获取其配置,并希望启用其属性的自动刷新。我已经按照 Spring Cloud Config文档来配置服务器和客户端应用程序,但是,当对本地 git 文件进行更改时,没有任何反应。
默认配置还检测本地 git 存储库中的文件系统更改(在这种情况下不使用 webhook,但一旦您编辑配置文件,就会广播刷新)。
任何人都可以指出什么可能是错误的或在 Spring Cloud 的代码中调试以检查它吗?
春天云服务器配置:
春天云服务器 pom.xml
Spring Cloud 配置启动日志:
客户端应用程序 pom.xml:
客户端应用配置:
客户端应用程序启动日志:
java - Spring cloud config在文件夹中组织文件
我正在尝试在我的 Git 存储库中的文件夹中组织一组配置文件。我在Spring Cloud Docs中读到这可以通过这种方式完成:
HTTP 服务具有以下形式的资源:
所以我按照第一个模式创建了我的配置结构:
app1/uat/application.yml
但是配置服务没有找到它。它并没有真正说明配置文件文件夹中的文件应该是什么样子,而且我到处都能看到第 2 和第 4 模式的示例。
第一种模式真的有效吗?有人可以举个例子吗?
spring-boot - 春季启动云配置
我想使用 spring cloud config 来外部化应用程序属性。我已经配置了配置服务器和客户端,但我不想使用 git(enterprise) 作为源,这是因为 git 可能因维护而停机。因此,我考虑将应用程序属性作为 application.properties.tar.gz 发布到 nexus 并执行以下操作:
1.) config-server 启动时,从nexus 下载release 版本,然后将tar.gz 解压到运行config-server 的服务器上的文件系统中。
2.) 将选择解压缩的属性文件的配置服务器。
请注意,nexus url、application.properties.tar.gz 版本和位置都作为 VM 选项传递给配置服务器。
这是一个明智的选择吗?如果这不是最佳选择,请您提出其他选择吗?
谢谢坎卡拉姆
java - Spring Cloud Config Server Priority of Environment Variables
I have a question regarding the priority of environment variables when working with spring cloud config server
In my service I have a local properties file application.yml
with this content
The service is also connected to a config server with a configuration repository that contains a file testservice-api.yml
(where testservice-api
is the spring application name of the service). The contents of this file is:
So with this setup the configuration at runtime would result in this:
Now I try to override foo.bar
and foo.joe
with an environment variable.
So I start the service with this command:
FOO_BAR=some-env FOO_JOE=some-env gradle bootRun
From what I read in this part of the spring boot documentation the environment variables should have priority over the configuration files - also the spring cloud config documentation does not state sth different - so I would expect the result to be:
But instead I get:
So only the configuration from the local configuration file inside the jar is overridden by the environment variable - the property from the config repo seems to have priority over the environment variable.
Is this explainable - Or is this a bug? Any hints in this one?
Please find the example code here:
https://github.com/mduesterhoeft/configserver-test
The README in the repository lists the issue described here as Use Case 3
spring-cloud - 为什么我的 EnableConfigServer encrypt.key / ENCRYPT_KEY 在 Pivotal Web 服务上不起作用?
我有一个 ConfigServer,非常基础:
我正在使用 spring-cloud-config-server:
我希望它在部署到 Pivotal Web 服务时的工作方式与我在本地运行时一样。
我使用加密密钥将我的配置部署到公共服务器:
在我的 bootstrap.yml、application.yml 中,我有一个带有密钥的属性:
这一切都在本地工作:
以正确解密的所有加密密码进行响应。
当我使用以下 manifest.yml 将相同的工件部署到 PWS 时:
如果我部署有或没有 env->ENCRYPT_KEY 都不起作用。当我调用该服务时,我所有的加密密钥都返回为
invalid.my.key.name: "<n/a>",
在 PWS 日志中,我可以看到:
当我查看http://myservice.on.pws/env时,我可以看到 application.yml、bootstrap.yml 中都有 encrypt.key 的值,我还可以看到环境值。这些都是相同的值。
当我在属性文件和/或环境中提供对称密钥值时,为什么我的加密值没有被正确解密?是否需要添加一些其他属性才能在 PWS 上进行这项工作?未加密的值在相同的配置中正常工作,因此一切都正确连接。只是加密的值不起作用。
spring - Spring Cloud Config Server - 安全细节
我实现了 Spring Cloud 配置服务器并将其推送到关键的 Cloud Foundry。我在 application.yml 中添加了以下列出的安全详细信息。我在配置服务器端点上做了一个“get”,没有传递任何安全凭证。我能够收到成功的响应,但我希望它返回一个错误,说明身份验证详细信息未通过。请你能告诉我我错过了什么吗?
java - Spring Cloud Config - 加密密码
我看到 spring cloud config 提供了一个/encrypt
和/decrypt
端点。如何通过高级 REST 客户端使用加密和解密端点来查看加密或解密的字符串?
spring - spring cloud config server - 没有这样的标签:master
我的云配置服务器正在返回属性文件,但现在我看到以下错误。请你能告诉我如何解决这个问题吗?
这部署在关键的云铸造环境中。
应用程序.yml
清单.yml
部署应用程序后,第一次命中端点会返回以下错误: