【问题标题】:Crash when starting Traefik in cluster mode在集群模式下启动 Traefik 时崩溃
【发布时间】:2017-09-06 09:21:22
【问题描述】:

我最近想从单节点 Traefik 安装(使用配置文件)更改为 3 节点 Traefik 集群。

按照文档,我上传了配置:

$ traefik storeconfig

它没有显示错误,并且检查了Consul KV,密钥在那里。

但是在集群模式下启动 Traefik 时,出现分段错误:

$ traefik --cluster=true -d

INFO[0001] Using TOML configuration file /etc/traefik/traefik.toml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x83500e]

goroutine 1 [running]:
github.com/containous/traefik/cluster.NewLeadership(0x2e08560, 0xc420557840, 0xc4202a1340, 0x0)
    /go/src/github.com/containous/traefik/cluster/leadership.go:28 +0x6e
github.com/containous/traefik/server.NewServer(0x2540be400, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc42035b930, 0x5, 0xc4205ef740, ...)
    /go/src/github.com/containous/traefik/server/server.go:105 +0x63e
main.run(0xc4205678c0)
    /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:307 +0x6f6
main.main.func1(0xc42016cdc0, 0xc4202b31a0)
    /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:61 +0xd9
github.com/containous/traefik/vendor/github.com/containous/staert.(*Staert).Run(0xc4206c1f30, 0x1aa1940, 0xc420496300)
    /go/src/github.com/containous/traefik/vendor/github.com/containous/staert/staert.go:83 +0x2e
main.main()
    /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:218 +0x1bf1

我尝试过最新的稳定版、1.3.7 和 1.4.0-rc1 版本,都显示相同的错误。

有什么想法吗?

【问题讨论】:

    标签: traefik


    【解决方案1】:

    我觉得您的 traefik.toml 不正确,并且您的 consul 后端没有正确的配置。

    尝试使用它作为您的命令或修改配置的 consul 部分 @ /etc/traefik/traefik.toml

    traefik --consul --consul.endpoint=YOURENDPOINTHERE --cluster=true -d

    一定要参考这个 https://docs.traefik.io/configuration/backends/consul/

    【讨论】:

    • 我最初确实尝试过,但这会导致完全相同的问题。奇怪的是,我可以在没有 --cluster 的情况下启动所有 Traefik 实例,它们仍将共享相同的 ACME 证书和配置,尽管偶尔会出现锁定问题。所以不确定集群标志,现在甚至无法在文档中找到它。也许不再需要?
    猜你喜欢
    • 2013-11-12
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多