conduktor / kafka-stack-docker-compose

docker compose files to create a fully working kafka stack
Apache License 2.0
3.24k stars 1.25k forks source link

Unable to resolve address: zoo1:2181 #62

Closed ltanme closed 2 years ago

ltanme commented 4 years ago

[main-SendThread(zoo1:2181)] WARN org.apache.zookeeper.ClientCnxn - Session 0x0 for server zoo1:2181, unexpected error, closing socket connection and attempting reconnect kafka1_1 | java.lang.IllegalArgumentException: Unable to canonicalize address zoo1:2181 because it's not resolvable kafka1_1 | at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:66) kafka1_1 | at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:39) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1087) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1139) kafka1_1 | [main-SendThread(zoo1:2181)] ERROR org.apache.zookeeper.client.StaticHostProvider - Unable to resolve address: zoo1:2181 kafka1_1 | java.net.UnknownHostException: zoo1 kafka1_1 | at java.net.InetAddress.getAllByName0(InetAddress.java:1281) kafka1_1 | at java.net.InetAddress.getAllByName(InetAddress.java:1193) kafka1_1 | at java.net.InetAddress.getAllByName(InetAddress.java:1127) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider$1.getAllByName(StaticHostProvider.java:92) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider.resolve(StaticHostProvider.java:147) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider.next(StaticHostProvider.java:375) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1137) kafka1_1 | [main-SendThread(zoo1:2181)] WARN org.apache.zookeeper.ClientCnxn - Session 0x0 for server zoo1:2181, unexpected error, closing socket connection and attempting reconnect kafka1_1 | java.lang.IllegalArgumentException: Unable to canonicalize address zoo1:2181 because it's not resolvable kafka1_1 | at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:66) kafka1_1 | at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:39) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1087) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1139) kafka1_1 | [main] ERROR io.confluent.admin.utils.ClusterStatus - Timed out waiting for connection to Zookeeper server [zoo1:2181]. kafka1_1 | [main-SendThread(zoo1:2181)] ERROR org.apache.zookeeper.client.StaticHostProvider - Unable to resolve address: zoo1:2181 kafka1_1 | java.net.UnknownHostException: zoo1 kafka1_1 | at java.net.InetAddress.getAllByName0(InetAddress.java:1281) kafka1_1 | at java.net.InetAddress.getAllByName(InetAddress.java:1193) kafka1_1 | at java.net.InetAddress.getAllByName(InetAddress.java:1127) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider$1.getAllByName(StaticHostProvider.java:92) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider.resolve(StaticHostProvider.java:147) kafka1_1 | at org.apache.zookeeper.client.StaticHostProvider.next(StaticHostProvider.java:375) kafka1_1 | at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1137) kafka1_1 | [main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x0 closed kafka1_1 | [main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x0

ltanme commented 4 years ago

cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.56.20 linux-node10 linux-node10.example.com

127.0.0.1 kafka1 127.0.0.1 kafka2 127.0.0.1 kafka3 127.0.0.1 zoo1 127.0.0.1 zoo2 127.0.0.1 zoo3 127.0.0.1 kafka-schema-registry 127.0.0.1 kafka-schema-registry-ui 127.0.0.1 kafka-rest-proxy 127.0.0.1 kafka-topics-ui 127.0.0.1 kafka-connect-ui 127.0.0.1 zoonavigator-web 127.0.0.1 zoonavigator-api

ltanme commented 4 years ago

@kdrakon @polomarcus @devshawn
Can your help me?

my env : docker-compose version 1.25.4, build 8d51620a Docker version 19.03.6, build 369ce74a3c Linux linux-node10.example.com 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux centos

doodleEsc commented 4 years ago

same problem

krysalead commented 4 years ago

Same for me

krysalead commented 4 years ago

Solved for me by replacing zoo1:2181 with zookeeper:2181

robsonpeixoto commented 3 years ago

Same problem here:

❯ docker version
Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df350
 Built:             Wed Jun  2 11:56:22 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:54:58 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
❯ docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020
ovats commented 3 years ago

I have the sample problem. Two years ago (when I took the course) it worked fine. I tried with that version (I got that docker file in my hd) and tried the new version but none of them worked ... :( Any updates to solve it? I will appreciate it!!!

ksh901016 commented 3 years ago

I added the option below and it works.(--user 1000) This is because zookeeper was not executed due to the error 'operation not permitted'.

...
volumes:
      - ./zk-single-kafka-single/zoo1/data:/data
      - ./zk-single-kafka-single/zoo1/datalog:/datalog --user 1000
simplesteph commented 3 years ago

@ksh901016 thanks for finding this. How did you find out about user 1000?

It may help with #84 and https://github.com/conduktor/kafka-stack-docker-compose/pull/85

ksh901016 commented 3 years ago

@simplesteph I don't know why it's working.. because I'm just googling it. It's not accurate, but I think all the problems in the issue are related to the M1 MacBook. I have 2 MacBooks, but not all compose.yml works only in M1. It all works fine on MacBooks, not M1

ovats commented 3 years ago

Just in case, my mac it's not M1. The docker-compose file worked fine about 1 year ago and when I needed 1 or 2 weeks ago it didn't work anymore ... so hardware is exactly the same ... very weird ... maybe could it be related to s.o. updates?

ksh901016 commented 3 years ago

@ovats Then I guess it's not related to the m1 MacBook. T.T

simplesteph commented 2 years ago

this seems linked to https://github.com/confluentinc/common-docker/issues/117

simplesteph commented 2 years ago

Can you all please test the docker-compose file on master and let me know if you're still having issues?

@ksh901016 @ovats @robsonpeixoto @ltanme @cinuor @krysalead

robsonpeixoto commented 2 years ago

Is working! Thanks

❯ docker-compose -f zk-single-kafka-multiple.yml up -d
[+] Running 4/4
 ⠿ Container zoo1                                 Started                                                                                                    0.9s
 ⠿ Container kafka-stack-docker-compose-kafka3-1  Started                                                                                                    1.8s
 ⠿ Container kafka-stack-docker-compose-kafka1-1  Started                                                                                                    1.9s
 ⠿ Container kafka-stack-docker-compose-kafka2-1  Started                                                                                                    1.8s

❯ kcat -L -b localhost:9092
Metadata for all topics (from broker -1: localhost:9092/bootstrap):
 3 brokers:
  broker 2 at 127.0.0.1:9093
  broker 3 at 127.0.0.1:9094 (controller)
  broker 1 at 127.0.0.1:9092
 0 topics:
SureshGanesanLTA commented 2 years ago

[main] ERROR io.confluent.admin.utils.ClusterStatus - Timed out waiting for connection to Zookeeper server [bldr-cp-zookeeper-headless:2181]. [main-SendThread(bldr-cp-zookeeper-headless:2181)] WARN org.apache.zookeeper.ClientCnxn - Client session timed out, have not heard from server in 40000ms for sessionid 0x0 [main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x0 [main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x0 closed

I get above error in kubernetes cluster. Any suggestion ?