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

Kafka cannot connect to zookeeper #150

Open
sangianpatrick opened this issue Jul 19, 2024 · 0 comments
Open

Kafka cannot connect to zookeeper #150

sangianpatrick opened this issue Jul 19, 2024 · 0 comments

Comments

@sangianpatrick
Copy link

sangianpatrick commented Jul 19, 2024

Hi I've just ran docker compose the file in the example (1 zk and 1 kafka). But I got the error show up that kafka cannot connect the zookeeper. I don't change anything the yaml file.

Heres the error logs on docker compose:

kafka1         | [2024-07-19 16:33:21,883] ERROR Unable to resolve address: zoo1:2181 (org.apache.zookeeper.client.StaticHostProvider)
kafka1         | java.net.UnknownHostException: zoo1: Name or service not known
kafka1         |        at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
kafka1         |        at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
kafka1         |        at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1534)
kafka1         |        at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
kafka1         |        at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1524)
kafka1         |        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1382)
kafka1         |        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)
kafka1         |        at org.apache.zookeeper.client.StaticHostProvider$1.getAllByName(StaticHostProvider.java:88)
kafka1         |        at org.apache.zookeeper.client.StaticHostProvider.resolve(StaticHostProvider.java:141)
kafka1         |        at org.apache.zookeeper.client.StaticHostProvider.next(StaticHostProvider.java:368)
kafka1         |        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1207)
kafka1         | [2024-07-19 16:33:21,884] WARN Session 0x0 for sever zoo1:2181, Closing socket connection. Attempting reconnect except it is a SessionExpiredException. (org.apache.zookeeper.ClientCnxn)
kafka1         | java.lang.IllegalArgumentException: Unable to canonicalize address zoo1:2181 because it's not resolvable
kafka1         |        at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:78)
kafka1         |        at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:41)
kafka1         |        at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1161)
kafka1         |        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1210)

Operating System: WSL2 Ubuntu 22.04.3 LTS

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant