Why Can’t I Connect to Kafka? | Troubleshoot Connectivity
Jun 9, 2020Robin Moffatt

Summary
This post details how to troubleshoot Kafka client connectivity issues by focusing on the `advertised.listeners` configuration. It explains the two-step connection process (initial bootstrap and subsequent broker connections) and highlights how misconfigurations in `advertised.listeners` can lead to connection failures. The article provides practical examples and solutions for common scenarios: client and Kafka on the same local machine, client and Kafka on different machines, and client and Kafka running in Docker containers. It emphasizes that `advertised.listeners` must return an address resolvable and accessible from the client machine.
More from the Kafka Client Connectivity Troubleshooting trail
- Diagnose and Debug Apache Kafka Issues: Understanding Increased Connections
- Diagnose and Debug Apache Kafka Issues: Understanding Increased Consumer Rebalance Time
- Diagnose and Debug Apache Kafka Issues: Understanding Increased Request Rate, Response Time, and/or Broker Load
- Reduced Message Throughput | Diagnose and Debug Kafka Issues Series
- 5 Common Pitfalls When Using Apache Kafka