<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
hi all, <br>
<br>
failed to set up swarm master HA cluster:<br>
here is my setup .<br>
<br>
2 master and 1 node, and I put a LB in front of 2 master
node(Round-Robin)<br>
<br>
I saw from swarm ha guide and get confirmed from swarm guys:<br>
<br>
<i>jimmyxian | elqiao: I'm here. :). Swarm does not support A-A. But
can access the standby manager, and it will proxy the request to
the primary manager</i><br>
<a class="moz-txt-link-freetext" href="https://docs.docker.com/swarm/multi-manager-setup/">https://docs.docker.com/swarm/multi-manager-setup/</a><br>
<br>
Swarm replica will do the proxy. but I tested failed.<br>
Since the LB use Round-Robin mode so it will access primary then
replica.<br>
every time if LB access primary node, the cluster works fine, but
failed when access replica.<br>
<br>
I wonder if the configuration is wrong ?<br>
<br>
<br>
<i>here is the ENV detail:</i><br>
<br>
<br>
master-1 172.24.5.33(floating ip) 192.168.0.5:2(private ip) primary<br>
<br>
root 1289 0.1 1.4 35456 29272 ? Ssl 10:02 0:07
/swarm manage -H tcp://0.0.0.0:2375 --replication --advertise
192.168.0.5:2375 --tlsverify --tlscacert=/etc/docker/ca.crt
--tlskey=/etc/docker/server.key --tlscert=/etc/docker/server.crt
etcd://192.168.0.3:2379/v2/keys/swarm/<br>
<br>
master-2 172.24.5.32(floating ip) 192.168.0.6(private ip) replica <br>
root 1678 0.1 0.8 23572 16824 ? Ssl 11:31 0:00
/swarm manage -H tcp://0.0.0.0:2375 --replication --advertise
192.168.0.6:2375 --tlsverify --tlscacert=/etc/docker/ca.crt
--tlskey=/etc/docker/server.key --tlscert=/etc/docker/server.crt
etcd://192.168.0.3:2379/v2/keys/swarm/<br>
<br>
<br>
on master-1 172.24.5.33 (primary)<br>
<br>
bash-4.3# docker -H tcp://172.24.5.33:2376 --tlsverify --tlscacert
ca.crt --tlskey server.key --tlscert server.crt info<br>
Containers: 6<br>
Images: 6<br>
Role: primary<br>
Strategy: spread<br>
Filters: health, port, dependency, affinity, constraint<br>
Nodes: 3<br>
sw-6ckizfpu4bl-0-mjy7qmxwbc6s-swarm-node-bynksfbxgibf.novalocal:
192.168.0.7:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
sw-ivtl4icqr-0-7a7s2ycpss2k-swarm-master-mxihlwsyjetc.novalocal:
192.168.0.5:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
sw-ivtl4icqr-1-35oewlqh25a7-swarm-master-idtxokrzgaek.novalocal:
192.168.0.6:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
CPUs: 3<br>
Total Memory: 6.158 GiB<br>
Name: 78443d1d9ad2<br>
Http Proxy: <a class="moz-txt-link-freetext" href="http://10.239.4.160:911/">http://10.239.4.160:911/</a><br>
Https Proxy: <a class="moz-txt-link-freetext" href="https://10.239.4.160:911/">https://10.239.4.160:911/</a><br>
No Proxy:
192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4,192.168.0.5,192.168.0.6,192.168.0.7<br>
<br>
I can see all containers of the cluster:<br>
<br>
bash-4.3# docker -H tcp://172.24.5.32:2376 --tlsverify --tlscacert
ca.crt --tlskey server.key --tlscert server.crt ps -a<br>
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES<br>
78443d1d9ad2 swarm:1.0.0 "/swarm manage -H tcp"
About an hour ago Up About an hour 0.0.0.0:2376->2375/tcp
swarm-manager<br>
d19e9ab13e07 swarm:1.0.0 "/swarm join --addr 1"
About an hour ago Up About an hour 2375/tcp
swarm-agent<br>
bash-4.3# docker -H tcp://172.24.5.33:2376 --tlsverify --tlscacert
ca.crt --tlskey server.key --tlscert server.crt ps -a<br>
CONTAINER ID IMAGE COMMAND
CREATED STATUS
PORTS NAMES<br>
0337ad1ad6a6 docker.io/cirros "ping -c 100 10.248.2" 50
minutes ago Exited (137) 26 minutes
ago
sw-6ckizfpu4bl-0-mjy7qmxwbc6s-swarm-node-bynksfbxgibf.novalocal/test_ping<br>
6a6e1f1327e2 swarm:1.0.0 "/swarm join --addr 1"
About an hour ago Up About an hour
2375/tcp
sw-6ckizfpu4bl-0-mjy7qmxwbc6s-swarm-node-bynksfbxgibf.novalocal/swarm-agent<br>
78443d1d9ad2 swarm:1.0.0 "/swarm manage -H tcp"
About an hour ago Up About an hour
192.168.0.5:2376->2375/tcp
sw-ivtl4icqr-0-7a7s2ycpss2k-swarm-master-mxihlwsyjetc.novalocal/swarm-manager<br>
d19e9ab13e07 swarm:1.0.0 "/swarm join --addr 1"
About an hour ago Up About an hour
2375/tcp
sw-ivtl4icqr-0-7a7s2ycpss2k-swarm-master-mxihlwsyjetc.novalocal/swarm-agent<br>
a4da371274bc swarm:1.0.0 "/swarm manage -H tcp"
About an hour ago Up 3 minutes
192.168.0.6:2376->2375/tcp
sw-ivtl4icqr-1-35oewlqh25a7-swarm-master-idtxokrzgaek.novalocal/swarm-manager<br>
a211d31dfc6e swarm:1.0.0 "/swarm join --addr 1"
About an hour ago Up About an hour
2375/tcp
sw-ivtl4icqr-1-35oewlqh25a7-swarm-master-idtxokrzgaek.novalocal/swarm-agent<br>
<br>
<br>
=========================================================================<br>
on master-2 172.24.5.32(replica)<br>
<br>
<br>
bash-4.3# docker -H tcp://172.24.5.32:2376 --tlsverify --tlscacert
ca.crt --tlskey server.key --tlscert server.crt info<br>
Containers: 6<br>
Images: 6<br>
Role: replica<br>
Primary: 192.168.0.5:2375<br>
Strategy: spread<br>
Filters: health, port, dependency, affinity, constraint<br>
Nodes: 3<br>
sw-6ckizfpu4bl-0-mjy7qmxwbc6s-swarm-node-bynksfbxgibf.novalocal:
192.168.0.7:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
sw-ivtl4icqr-0-7a7s2ycpss2k-swarm-master-mxihlwsyjetc.novalocal:
192.168.0.5:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
sw-ivtl4icqr-1-35oewlqh25a7-swarm-master-idtxokrzgaek.novalocal:
192.168.0.6:2375<br>
└ Containers: 2<br>
└ Reserved CPUs: 0 / 1<br>
└ Reserved Memory: 0 B / 2.053 GiB<br>
└ Labels: executiondriver=native-0.2,
kernelversion=3.17.4-301.fc21.x86_64, operatingsystem=Fedora 21
(Twenty One), storagedriver=devicemapper<br>
CPUs: 3<br>
Total Memory: 6.158 GiB<br>
Name: a4da371274bc<br>
Http Proxy: <a class="moz-txt-link-freetext" href="http://10.239.4.160:911/">http://10.239.4.160:911/</a><br>
Https Proxy: <a class="moz-txt-link-freetext" href="https://10.239.4.160:911/">https://10.239.4.160:911/</a><br>
No Proxy:
192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4,192.168.0.5,192.168.0.6,192.168.0.7<br>
<br>
<b>Only local containers can be list:</b><br>
<br>
bash-4.3# docker -H tcp://172.24.5.32:2376 --tlsverify --tlscacert
ca.crt --tlskey server.key --tlscert server.crt ps -a<br>
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES<br>
78443d1d9ad2 swarm:1.0.0 "/swarm manage -H tcp"
About an hour ago Up About an hour 0.0.0.0:2376->2375/tcp
swarm-manager<br>
d19e9ab13e07 swarm:1.0.0 "/swarm join --addr 1"
About an hour ago Up About an hour 2375/tcp
swarm-agent<br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
BR, Eli(Li Yong)Qiao</pre>
</body>
</html>