Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose-swarm kafka unable to connect zookeeper #447

Closed
csifinos opened this issue Jan 9, 2019 · 3 comments
Closed

docker-compose-swarm kafka unable to connect zookeeper #447

csifinos opened this issue Jan 9, 2019 · 3 comments

Comments

@csifinos
Copy link

csifinos commented Jan 9, 2019

I have used the docker-compose-swarm.yml with docker stack, but the Kafka could not connect with zookeeper.

The command that I executed docker stack deploy -c docker-compose-swarm.yml test

The error is the following:

INFO Socket error occurred: zookeeper/10.0.1.2:2181: Connection refused (org.apache.zookeeper.ClientCnxn)
INFO Opening socket connection to server zookeeper/10.0.1.2:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)

I believe the problem is on the virtual IP of Zookeeper's service (KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181) which is not exactly the same as Zookeeper's IP (Zookeeper Virtual IP 10.0.1.2 and Zookeeper IP 10.0.1.3).

Please find below also the results (only the networks) of "docker inspect zookeeperId":

"Networks": {
	"test_default": {
		"IPAMConfig": {
			"IPv4Address": "10.0.1.3"
		},
		"Links": null,
		"Aliases": [
			"8a31389d113b"
		],
		"NetworkID": "xfyyq1bht5h172h0cx70kesed",
		"EndpointID": "7df594b8bbccd58e39d81daf583cd1915d7fdf7b2341275a8450ed03b89e1876",
		"Gateway": "",
		"IPAddress": "10.0.1.3",
		"IPPrefixLen": 24,
		"IPv6Gateway": "",
		"GlobalIPv6Address": "",
		"GlobalIPv6PrefixLen": 0,
		"MacAddress": "02:42:0a:00:01:03",
		"DriverOpts": null
	},
	"ingress": {
		"IPAMConfig": {
			"IPv4Address": "10.255.0.6"
		},
		"Links": null,
		"Aliases": [
			"8a31389d113b"
		],
		"NetworkID": "84w6cqxuluawi9knheaibgsz3",
		"EndpointID": "27d4bdb8b83356fd82cdf996b19b00d471e8b280967ddff91a3e165bd91245b9",
		"Gateway": "",
		"IPAddress": "10.255.0.6",
		"IPPrefixLen": 16,
		"IPv6Gateway": "",
		"GlobalIPv6Address": "",
		"GlobalIPv6PrefixLen": 0,
		"MacAddress": "02:42:0a:ff:00:06",
		"DriverOpts": null
	}
}

Thank you in advance, any advice will be usefull.

@sscaling
Copy link
Collaborator

sscaling commented Jan 9, 2019

I'm a little bit confused. If you are using the docker-compose-swarm.yml file, why does Zookeeper have two virtual IPs? there should only be one instance.

Have you performed any diagnostics? i.e. from the kafka container telnet / netcat to the zookeeper node + port? Try connecting to the zookeeper node from an external client other than kafka? etc.

@csifinos
Copy link
Author

Hello sscaling,

You have right that only one zookeeper instance is running, sorry if I am confused you. I have tried it again in another machine (Linux OS, not in windows as the previous attempt) and it works fine. So I believe that something I have messed up in the docker network.

I appreciate your help.

@sscaling
Copy link
Collaborator

np. Thanks for closing the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants