Docker Swarm新节点Traefik启动失败排查求助
问题:Traefik加入新Swarm节点后启动失败,仅加载file.provider后停止
问题现象
- 新增Linux节点加入Docker Swarm集群后,部署Traefik全局服务到该节点时启动失败,日志仅显示启动
file.provider后就停止,健康检查失败 - 暂停新节点后,原有节点上的Traefik也出现同样故障
故障日志
time="2022-07-21T17:34:23Z" level=info msg="Starting provider aggregator aggregator.ProviderAggregator" time="2022-07-21T17:34:23Z" level=info msg="Starting provider *file.Provider"
Traefik配置文件
providers: file: directory: /etc/traefik/config.d watch: false docker: endpoint: "unix:///var/run/docker.sock" swarmMode: true exposedByDefault: false network: "traefik" swarmModeRefreshSeconds: 10 consul: rootKey: "traefik" endpoints: - "consulagent:8500"
Traefik的Docker Compose文件
--- version: '3.7' services: traefik: deploy: labels: com.docker.compose.version: "%1$s" com.docker.compose.commit: "%2$s" com.docker.compose.build_date: "%3$s" com.docker.compose.vcs_url: "%4$s" restart_policy: condition: any mode: global placement: constraints: - node.role == manager image: %5$s environment: CONSUL_HTTP_TOKEN: '#{CONSUL_HTTP_TOKEN}' ports: - target: 8080 published: 8080 protocol: tcp mode: host - target: 80 published: 80 protocol: tcp mode: host - target: 443 published: 443 protocol: tcp mode: host - target: 9300 published: 9300 protocol: tcp mode: host - target: 9200 published: 9200 protocol: tcp mode: host healthcheck: test: ["CMD", "curl", "-fks", "-o", "/dev/null", "http://localhost:8080/ping"] interval: 10s timeout: 5s retries: 4 networks: connect: volumes: - /var/run/docker.sock:/var/run/docker.sock - /mnt/data/traefik_log:/var/log/traefik - /mnt/gv0/certificate-robot/letsencrypt:/etc/letsencrypt:ro networks: connect: external: true
疑问
是否有人遇到过相同问题?问题原因是什么?
内容的提问来源于stack exchange,提问作者DavidB.
相关产品推荐
相关产品推荐

