Docker Community Forums

Share and learn in the Docker community.

Docker swarm problem for server with dual NICs


(Longzaitianbian) #1

I have two servers aether and themis with dual NICs.
aether has the namespace 151 and 152 for its two NICs, while themis has the namespaces 153 and 154 for its two NICs.

I create a swarm on 151 of aether by
“ip netns exec 151 docker swarm init --advertise-addr” It shows

"Swarm initialized: current node (s5xb8j4nd3f49ygqbiowmd7rf) is now a manager.

To add a worker to this swarm, run the following command:

docker swarm join --token SWMTKN-1-4m1y77gnxvfpkq5bhl23of4kby1mgfdo0yed8feiq2qjpk2ix3-35lo031qun46p75au62g93j0b

To add a manager to this swarm, run ‘docker swarm join-token manager’ and follow the instructions."

Then when I use the above commannd on server themis, it does not work.The details is shown below:
When I type “docker swarm join --token SWMTKN-1-4m1y77gnxvfpkq5bhl23of4kby1mgfdo0yed8feiq2qjpk2ix3-35lo031qun46p75au62g93j0b” on themis.

It shows
“Error response from daemon: Timeout was reached before node joined. The attempt to join the swarm will continue in the background. Use the “docker info” command to see the current swarm status of your node.”

When I type “docker info”. It will shows

"Containers: 3
Running: 0
Paused: 0
Stopped: 3
Images: 3
Server Version: 18.05.0-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 20
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: error
Error: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Is Manager: false
Node Address:
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Kernel Version: 3.16.0-6-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.854GiB
Name: vm1
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support"

When I add the namespace and use ip netns exec 154 docker swarm join --token SWMTKN-1-4m1y77gnxvfpkq5bhl23of4kby1mgfdo0yed8feiq2qjpk2ix3-35lo031qun46p75au62g93j0b
on server themis. It is the same result as without namespce.

I am sure the network is fine. becasue when I ping, it works. When I use the below ping command on themis
root@vm1:~# ip netns exec 154 ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.303 ms
64 bytes from icmp_seq=2 ttl=64 time=0.164 ms
64 bytes from icmp_seq=3 ttl=64 time=0.156 ms
64 bytes from icmp_seq=4 ttl=64 time=0.323 ms

When I tried with another two serves with single NIC for join the swarm. there is no problem.

I find solution from internet to diasble the firewall, and synchriozed the clock of the two servers, All do not work. And I tried telnet commmand, which is also not working. I think if telnet work. the join swarm should also work. But I can not know where is the problem and how to slove it

my system is Debian GNU/Linux 8 \n \l

docker -v is
Docker version 18.05.0-ce, build f150324

Thanks a lot.