Skip to main content
iamabug
Gold ⭐️
Nov 5, 2019 11:19 AM UTC
Solved

wrong alerts when configuring two listeners for Kafka in Ambari

I install Kafka in Ambari and configure two listeners for every broker, one for inner traffic and one for outer traffic. E.g., broker A has two ip addresses: 192.168.1.1 and 88.88.88.88, and its configuration is like follows:

 

SASL_PLAINTEXT://192.168.1.1:9092,EXTERNAL://88.88.88.88:19092
listener.security.protocol.map=SASL_PLAINTEXT:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT
security.inter.broker.protocol=SASL_PLAINTEXT

 

With this configurations, Kafka works fine but keeps alerting, the message is:

 

Connection failed: [Errno 111] Connection refused to 192.168.1.1:19092

 

 This is not valid because ip and port do not match. And I suspect that it could just split by colon and use the last element. So I exchange the order of the two listeners:

 

EXTERNAL://88.88.88.88:19092,SASL_PLAINTEXT://192.168.1.1:9092

 

To my surprise, it still alerts and the message changes to 

 

Connection failed: [Errno 111] Connection refused to 88.88.88.88:9092

 

ip and port still do not match ? 
Have anybody also run into this or am I misconfiguring something ? Or this is a bug ?

iamabug
iamabugAnswer
Gold ⭐️
Nov 10, 2019 1:07 AM UTC

@Shelton Glad that you reproduce this problem. I have ten brokers and every broker is configured with their respective IP addresses but I am afraid I cannot provide screenshot for some reasons. I have a workaround for this problem. In my own opinion, the reason of this problem is that Ambari cannot recognize IP and port bindings correctly. So to solve this is to avoiding the challenge for it. Here is my configuration now:

 

listeners=SASL_PLAINTEXT://0.0.0.0:9092,EXTERNAL://0.0.0.0:19092
advertised.listeners=SASL_PLAINTEXT://192.168.1.1:9092,EXTERNAL://88.88.88.88:19092

The other configurations stay unchanged. Notice that I change `listeners` so that even Ambari  cannot recognize the right IP and port binding, both ports are now available on all interfaces so there are no false alerts now.

Thanks you so much for helping me on this problem and apologize for this late response.

5 replies

Shelton
Gold ⭐️⭐️⭐️
Nov 5, 2019 8:09 PM UTC

@iamabug 

I think it's a misconfiguration can you see the differences between these 2? The one in Black and BOLD is your current remove the ( = ) and replace it with a colon ( : ) and space after 

 

listener.security.protocol.map=SASL_PLAINTEXT:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT          [old]


listener.security.protocol.map: SASL_PLAINTEXT:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT              [New]

Restart the brokers and let me know if you still encounter the problem

 

Translate
iamabug
iamabugAuthor
Gold ⭐️
Nov 6, 2019 1:36 AM UTC

@Shelton Hi, I am only using (=) to represent the configuration key and value. In Ambari, there is no need and no place to type (=) or (: ).

Translate
Shelton
Gold ⭐️⭐️⭐️
Nov 6, 2019 7:11 AM UTC

@iamabug 

I now get you so yours is Ambari managed let me get back to you after testing

Translate