【问题标题】:Spring Cloud Config Server: configure git pull intervalSpring Cloud Config Server:配置 git pull 间隔
【发布时间】:2016-07-06 22:49:39
【问题描述】:

我正在使用通过 BitBucket git 存储库连接到 Eureka Server 的 Spring Cloud Config Server。 我在调试器下发现,每次配置服务器使用 Eureka 更新其状态时,都会通过调度程序调用 org.eclipse.jgit.api.PullCommand#call。 此外,每次连接的服务查询更新的配置时都会调用它,甚至每次在 Spring Cloud Config Server 或连接的客户端上请求 /health 端点时。

我认为这在 HTTP 响应时间和传出流量方面都是一个很大的开销。

有没有办法减少更新本地克隆存储库的频率?

附:我知道有一个File System Backend,或者我可以将配置服务器指向手动克隆的本地(即file:///)存储库。但我想知道是否有开箱即用的功能。

【问题讨论】:

    标签: spring spring-boot spring-cloud


    【解决方案1】:

    您可以通过配置客户端上的spring.cloud.config.server.health.enabled=falsehealth.config.enabled=false 关闭配置服务器上的健康指示器。配置服务器的请求总是克隆,因此您需要关闭或禁用健康检查。

    【讨论】:

    • Spencergibb,如果我错了,请纠正我,但在这种情况下,任何 git 提供程序中断或连接问题都会导致配置服务器不可用(即它将无法为服务)
    猜你喜欢
    • 2020-04-22
    • 2017-06-23
    • 2021-05-25
    • 2019-08-11
    • 2020-07-02
    • 1970-01-01
    • 2015-08-25
    • 2019-03-20
    • 2023-01-27
    相关资源
    最近更新 更多