Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Kafka broker bind to 0.0.0.0

avatar
New Contributor

Currently we have deployed a kafka service over CDH 5.7.2. Our cluster has two interfaces per host. One for remote access and another one for cluster intra-communication.

 

Everything is working properly if we access through internal cluster ports. However, we cannot access from external interfaces. Ports are closed. Kafka only binds to internal ports.

 

In order to bind to external ports, we should use host.name environment. However, Cloudera Manager does not allow to use environment variables with a dot (host.name) in it. Is there any way to surpass this limitation??

 

We have also got kafka to bind all IPs by modifiying listerners=PLAINTEXT://0.0.0.0 parameter, but the problem in this case is that zookeeper takes 0.0.0.0 as broker name and so it cannot be resolved at client.

 

Meanwhile, we have used iptables in order to forward traffic to port 9092 at external interface to internal interface, but this is not the way we should proceed.

 

Any hint about using host.name parameter?

 

Thanks in advance. 

1 REPLY 1

avatar
Expert Contributor

Hello,

 

You can do the following step:

 

Kafka > Instances (Select Instance) > Configuration > Kafka Broker > Advanced > Kafka Broker Advanced Configuration Snippet (Safety Valve) for kafka.properties

 

Please add (example):

 

listeners=PLAINTEXT://192.10.0.1:9092,PLAINTEXT://10.0.3.3:9092

 

Gabor