我正在尝试将consul代理作为docker容器运行。但是,当我在docker-compose.yml中进行如下所示的卷映射时,容器始终保持重新启动。
b1c4c6975b37 privatedockerhub/consul-agent:0.6.4 "/bin/consul agent -c" 3 seconds ago Restarting (1) Less than a second
docker-compose.yml如下所示
agent:
hostname: abcd.com
container_name: consul_agent_new
image: privatedockerhub/consul-agent:0.6.4
restart: always
environment:
- SERVICE_IGNORE=always
volumes:
- /etc/consul.d/client/config.json:/config/agent.json
ports:
- 8300:8300
- 8301:8301
- 8301:8301/udp
- 8302:8302
- 8302:8302/udp
- 8400:8400
command: -join 11.210.244.103 -join 11.210.244.104
config.json如下所示:
{
"client_addr": "0.0.0.0",
"data_dir": "/data",
"leave_on_terminate": true,
"dns_config": {
"allow_stale": true,
"max_stale": "1s",
"service_ttl": {
"*": "10s"
}
},
"disable_update_check": true
}
答案 0 :(得分:0)
在未运行syslog守护程序的位置出现此错误。在我们的情况下,我们甚至不需要它,因为当我们在docker容器内运行consul时,它将把日志写入docker标准/var/lib/docker/containers/*/*.log
路径,而不是syslog上。
就我而言,我只是在配置文件"enable_syslog": false
中将其关闭,然后它开始工作。