I can't connect to Kafka in OS X
See original GitHub issueHi.
I’d been having problems launching Kafka (more about this in this recent thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/confluent-platform/DRd_XfeW0C8).
Now, I launched Kafka, however, I can’t connect it:
# the kafka container uses this port
$ telnet localhost 29092
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
PS: I’m trying this docker-compose.yml.
This is my altered docker-compose.yml file:
I tried to expose the ports, however, I think, in network host mode, it can’t be done.
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
network_mode: host
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
extra_hosts:
- "moby:127.0.0.1"
kafka:
image: confluentinc/cp-kafka:latest
network_mode: host
ports:
- "29092:29092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: localhost:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092
extra_hosts:
- "moby:127.0.0.1"
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
Why Can't I Connect to Kafka? | Troubleshoot Connectivity
When a client wants to send or receive a message from Apache Kafka ®, there are two types of connection that must succeed:...
Read more >Cannot run Kafka on mac - Stack Overflow
1 Answer 1 · Shutdown both Kafka and Zookeeper · If required, take backup of the existing logs of Kafka and Zookeeper ·...
Read more >Can't connect to Kafka on Apple Silicon · Issue #647 - GitHub
Hello. When i am trying to run kafka on apple with silicon m1 chip, i have no errors on logs, but can't connect...
Read more >How to Install Kafka on Mac? | 3 Easy Steps - Hevo Data
This article provides you with a step-by-step guide to easily Install Kafka on Mac Manually as well as via Homebrew commands.
Read more >Apache Kafka Installation on Mac using Homebrew - Medium
WARNING: During server start, you might be facing connection broken issue. ... To fix this issue, we need to change the server.properties file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to have some success on macOS (docker community version) using the following compose file:
Which allows kafka to connect to the zookeeper instance using the bridge network but both remain accessible to a Java application running on my development machine at localhost and the exposed correct port. I hope this proves useful.
Note: I am not using the most recent version of the cp-zookeeper and cp-kafka docker images.
Probably, noone is looking at these issues…