[2024-04-06 15:03:19,359] WARN [AdminClient clientId=adminclient-1] Connection to node 1 (localhost/127.0.0.1:9091) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2024-04-06 15:03:19,361] WARN [AdminClient clientId=adminclient-1] Connection to node 2 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2024-04-06 15:03:19,361] WARN [AdminClient clientId=adminclient-1] Connection to node 3 (localhost/127.0.0.1:9093) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2024-04-06 15:03:19,462] WARN [AdminClient clientId=adminclient-1] Connection to node 1 (localhost/127.0.0.1:9091) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
From the shell (within the docker container) I can correctly ping the nodes. E.g.
[appuser@14b87f3a1ce1 ~]$ ping broker-3
PING broker-3 (172.18.0.5) 56(84) bytes of data.
64 bytes from broker-3.kafka (172.18.0.5): icmp_seq=1 ttl=64 time=0.202 ms
64 bytes from broker-3.kafka (172.18.0.5): icmp_seq=2 ttl=64 time=0.178 ms
I'm using Docker on macOS and it seems that the problem could be on the DNS. But I couldn't find the solution.
I'm having some issues in running shell commands on the Kafka cluster defined in https://github.com/ruanbekker/quick-starts/blob/main/docker/kafka/docker-compose.yaml.
Consumer and producer correctly work and Kafka cluster works too, but if I try to run a Docker container with:
and try this:
I get these errors:
From the shell (within the docker container) I can correctly ping the nodes. E.g.
I'm using Docker on macOS and it seems that the problem could be on the DNS. But I couldn't find the solution.