Filebeat Error: 'kafka: client has run out of available brokers to talk to' — Cause, Fix, and Troubleshooting Guide
Fix Filebeat 'kafka: client has run out of available brokers to talk to': repair broker addresses, advertised listeners, TLS, and SASL for the Kafka output.
- #filebeat
- #logging
- #troubleshooting
- #errors
Stuck on this Filebeat error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
What this error means
Filebeat’s kafka output bootstraps by connecting to the brokers you list, then discovers the full broker set from metadata. When it cannot reach any broker — or the addresses it learns are unreachable — the underlying client gives up:
Failed to connect to broker kafka01:9092: dial tcp: lookup kafka01 on 10.0.0.2:53: no such host
kafka: client has run out of available brokers to talk to: EOF
The tell is that Filebeat exhausted every broker it knows and none accepted a connection. The usual culprits are wrong bootstrap addresses, brokers advertising internal hostnames the Filebeat host cannot resolve, or a TLS/SASL handshake that fails so every broker is marked unavailable. No events publish until at least one broker is reachable and the handshake succeeds.
How the agent reports it
kafka: client has run out of available brokers to talk to(often withEOFordial tcpbefore it).Failed to connect to broker <host>:<port>for each configured broker.- Works from the broker host but not from the Filebeat host (advertised-listener mismatch).
- Started after enabling TLS/SASL or changing
advertised.listenerson Kafka.
Checking the agent configuration
Confirm basic reachability from the Filebeat host:
nc -vz kafka01 9092
getent hosts kafka01
Run Filebeat with output debug to see the metadata/broker negotiation:
filebeat -e -d "kafka" -c /etc/filebeat/filebeat.yml
Check what the brokers advertise — a mismatch here is the classic cause:
kafka-broker-api-versions.sh --bootstrap-server kafka01:9092 2>&1 | head
# or inspect server.properties: advertised.listeners=
Agent configuration causes
- Wrong bootstrap
hosts— unreachable address or port. - Advertised listeners returning internal hostnames Filebeat cannot resolve.
- TLS handshake failure — untrusted CA, hostname mismatch, or plaintext-vs-TLS mismatch.
- SASL auth failure — wrong mechanism/credentials, marking brokers unavailable.
- Firewall/security group blocking 9092/9093 from the Filebeat host.
- Kafka down or the topic’s leader broker offline.
Step-by-step resolution
List reachable brokers and match the advertised-listener names your host can resolve:
output.kafka:
hosts: ["kafka01:9092", "kafka02:9092", "kafka03:9092"]
topic: "filebeat-logs"
partition.round_robin:
reachable_only: true
required_acks: 1
If the brokers advertise internal names, add host entries or fix advertised.listeners on Kafka so the returned addresses resolve from the Filebeat host. For TLS:
output.kafka:
hosts: ["kafka01:9093"]
ssl.certificate_authorities: ["/etc/filebeat/certs/kafka-ca.pem"]
ssl.verification_mode: "full"
For SASL, set the mechanism and credentials the cluster expects:
output.kafka:
username: "filebeat"
password: "${KAFKA_PASS}"
sasl.mechanism: "SCRAM-SHA-512"
Test the output after each change:
filebeat test output
Safer agent defaults
- The bootstrap
hostsonly start discovery; the advertised listeners must also be reachable. - A plaintext client against a TLS listener (or vice versa) fails every broker with cryptic EOFs.
reachable_only: trueavoids stalling on a dead partition leader.- SASL mechanism must match the broker exactly (
PLAINvsSCRAM-SHA-256/512).
Related agent errors
- Filebeat Error Guide: ‘connection refused’
- Filebeat Error Guide: ‘backoff(elasticsearch(…)): lookup: no such host’
- Filebeat Error: ‘Connection marked as failed because the onConnect callback failed’
Fixed it? Get 500 Filebeat & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Trending errors this week
The error guides other engineers are actually reading right now.
- 1mount: wrong fs type, bad option, bad superblock
- 2Docker 'failed to set up container networking': Fix the Bridge and IP Pool
- 3Docker 'failed to create shim task': How to Fix the containerd Runtime Error
- 4modprobe: FATAL: Module not found
- 5mount: wrong fs type, bad option, bad superblock
- 6Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.