docker swarm join connection error from other instance and local pc - docker

I gave role like this.
env: oracle cloud.
open port: TCP 2377 , UDP TCP 7946 ,UDP 4786
Instance A : manager
Instance B : worker
Local PC : worker
init swarm mode with this cli on A
docker swarm init --advertise-addr <A's IP>
B got
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp A's IP:2377: connect: no route to host"
Local PC got
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp A's IP:2377: connect: connection refused"
well I have no idea what should I need to do more.
thank you in advance.

the problem was firewall setting on manager node's instance.
sudo firewall-cmd --add-port=2377/tcp --permanent
sudo firewall-cmd --reload

for me #Logan Lee solution perfectly matched.
According to the docker documentation, following ports need to manage accordingly
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network traffic
Thanks #Logan Lee

Check the network connectivity between A and B, seems like they are not on the same network.

Related

Docker Swarm running inside VM workstation 15 player doesn't accept worker connection

I am running a docker swarm manager in VM Workstation 15 player with NAT(VM: Ubuntu 19.10, Host: Windows 10). I ran docker swarm init --advertise-addr 223.181.240.48:2377 on my mangager vm. Now i copied to the token and used it on my my other vm that is running on another node and another network with NAT. it returns the following error:
Error response from daemon: Timeout was reached before node joined.
The attemp to join the swarm will continue in the background. Use the
"docker info" command to see the current swarm status of your node.
Then i tried googling for error and got to know that the problem may arise due to firewall and i might have to unblock the port.Also, as i am using NAT, i have to either use automatic bridge or port forward.First, I tried using bride(in vm setting, i changed network to bridge), but when i tried "my ip",the results were same in both host machine and vm(223.181.240.48).So, i tried port forwarding with NAT,i went to C:/ProgramData/VMware/vmnetnat.conf and added the following line
[incomingtcp]
2377:192.168.172.2:2377
192.168.172.2 is my vm's net gateway address. Then i again ran the docker swarm command, copied to my other vm. Now, i got the following error:
Error response from daemon: rpc error: code =Unavailable desc = all
SubConns are in TransientFailure, latest connection error: connection
error: desc = "transport: Error while dialing dial tcp
233.181.240.48:2377: connect: connection refused"
Then i tried sudo ufw allow 2377/tcp to unblock port in vm. Then retried the whole procedure again. Now i am again receiving the timeout error. Did i miss something in the middle? or did something wrong? And what is the difference between the ip i receive through a "my ip " google search and the ipv4 i receive in wired connection setting(dhcp on).

Docker Swarm: Getting connection refuse while adding worker node

I just started learning docker, I am facing below challenge, please let me know where I am doing wrong.
My use case: Set up docker swarm manager and add worker node to it.
Step1: To create docker manager, I used below command:
docker swarm init --advertise-addr <<ip_address>>
Step 2: Run below command, which gives you docker command to add worker.
docker swarm join-token worker
After running above command, I got output as:
docker swarm join --token SWMTKN-1-653srs28a6s48dqxnak9g9kic2cd1xyeowgnke53nf83710wfv-7u7u7u1vovahvn792814q2sts ip_address:2377
Step3: I logged-in to worker node and ran above docker swarm join command. But I am getting below error message.
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection er
ror: desc = "transport: Error while dialing dial tcp ip_address:2377: connect: connection refused"
This could well be a firewall issue, make sure you have port 2377, 7946 & 4789 in open state between the hosts acting as manager or worker node -
From the docs -
Open protocols and ports between the hosts The following ports must be
available.
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network
traffic

Disable ipv6 for docker in Ubuntu 14.04

I have an issue with the docker daemon installed on an Ubuntu 14.04 VM. The logs reveal that ipv6 is enabled hence the docker seems to be listening on this ip address. Essentially, this effects Clair. I have made sure that ipv6 is disabled on the following recommendation here. I also disabled ipv6 in daemon.json as specified in Docker documentation. My docker version is Docker version 17.06.1-ce, build 874a737.
Docker daemon logs :
time="2018-02-20T20:33:17.736203462+01:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 20 01:4860:4860::8844]"
Clair logs:
2018/02/20 20:43:51 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp [::]:6060: connect: cannot assign requested address"; Reconnecting to {[::]:6060 <nil>}
2018/02/20 20:46:14 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp [::]:6060: connect: cannot assign requested address"; Reconnecting to {[::]:6060 <nil>}
It's trying to make an IPv6 connection, but the address is wrong. [::] is IN6ADDR_ANY, not an actual address you can connect to. Provide the correct address in your config.yaml.
Did you mean to connect to localhost?
api:
# v3 grpc/RESTful API server address
addr: "[::1]:6060"

Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused

I have a kubernetes cluster with three nodes: 10.9.84.149,10.9.105.90 and 10.9.84.149. When my application tries to execute the command inside some pod:
kuebctl exec -it <podName>
it sometimes gets an error:
Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused
As far as I could see everything was fine with the cluster: all kube-system services and pods were running well. Besides, it didn't appear regularly.
Can anybody help me on this issue?
I got the same error as this below
Error from server: Get https://192.168.100.102:10250/containerLogs/default/kubia-n8nv9/kubia: dial tcp 192.168.100.102:10250: connect: no route to host
DISABLING THE FIREWALL WAS MY FIX ON ALL NODES
I figured out my worker nodes firewall was not disabled. I did instruction below to fix my problem
systemctl disable firewalld && systemctl stop firewalld
-Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1...
-Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.```
Looks like your kubelet process not running, or keep restarting.
ss -tnpl |grep 10250
LISTEN 0 128 :::10250 :::* users:(("kubelet",pid=1102,fd=21))
check kubelet process is running.
if its running see when its started.
look at /var/log/message file for any issue with node.
Make sure you don't have the firewall blocking the traffic

Flanneld not working in Kubernetes Multinode Example

I am trying to follow this tutorial with two Vagrant instances:
http://kubernetes.io/v1.0/docs/getting-started-guides/docker-multinode.html
After setting up master and worker node I tried to connect to the service's IP of a simple nginx-service from the master. But it looks like the kube-proxy cannot find the docker-container of the worker-node.
The virtual IP of the service and the container-ip respond well on the worker-node
That made me think of a misfunction of flanneld.
Does anybody know how I could track down this error?
Any help is appreciated!
Thanks in advance
Best, Johannes
Output of Kube-Proxy container
I1016 20:53:42.829290 1 proxysocket.go:130] Accepted TCP connection from 10.0.2.15:51774 to 10.0.2.15:40197
E1016 20:53:43.829575 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: i/o timeout
E1016 20:53:45.825473 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:48.825556 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:51.825627 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:51.825710 1 proxysocket.go:133] Failed to connect to balancer: failed to connect to an endpoint.
This looks like https://github.com/kubernetes/kubernetes/issues/14426. Try upgrading flannel to 0.5.3.

Resources