Error response from daemon: --cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode

将docker worker node加入swarm集群时,出现以下错误

1.试验环境:

centos7

2.报错翻译:--cluster-store和--cluster-advertise后台配置与集群不一致

3.分析:--cluster-advertise是用来指定集群与其他node的通信地址的

            --cluster-store是我之前做网络实验的时候配置了etcd集群的通信地址用的

在添加worker node的时候二者发生了冲突导致的

4.解决办法

将/etc/systemd/system/docker.service.d/10-machine.conf

文件中的--cluster-store,删除即可,保存退出后,重启服务

systemctl daemon-reload

 systemctl restart docker.service

如果上述方法不能解决,请参考:http://www.chinacloud.cn/show.aspx?id=25332&cid=22

或者参考:https://github.com/moby/moby/issues/24569

原文地址:https://www.cnblogs.com/lkun/p/8032459.html