【实践】consul中如何禁止updates检查

问题描述:

在使用consul过程中,经常会进行版本检查,日志如下:

==> Failed to check for updates: Get https://checkpoint-api.hashicorp.com/v1/check/consul?arch=amd64&os=linux&signature=33c85560-784e-27cf-802d-6ae0ec8d197f&version=1.1.0: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

如何禁止哪?

解决方案:

在版本v1.0.5之后,提供了新的配置选项disable_update_check 可禁止检查

但仅在企业版中有效

参见

https://github.com/hashicorp/consul/blob/v1.1.0/CHANGELOG.md#105-february-7-2018

方案二:

修改代码

diff --git a/agent/config/flags.go b/agent/config/flags.go
index 3bad0ea..02b8200 100644
--- a/agent/config/flags.go
+++ b/agent/config/flags.go
@@ -70,6 +70,7 @@ func AddFlags(fs *flag.FlagSet, f *Flags) {
        add(&f.Config.Ports.DNS, "dns-port", "DNS port to use.")
        add(&f.Config.DNSDomain, "domain", "Domain to use for DNS interface.")
        add(&f.Config.EnableScriptChecks, "enable-script-checks", "Enables health check scripts.")
+       add(&f.Config.DisableUpdateCheck, "disable_update_check", "Disable consul update check.")
        add(&f.Config.EncryptKey, "encrypt", "Provides the gossip encryption key.")
        add(&f.Config.Ports.HTTP, "http-port", "Sets the HTTP API port to listen on.")
        add(&f.Config.StartJoinAddrsLAN, "join", "Address of an agent to join at start time. Can be specified multiple times.")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YoungerChina

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值