0

I am trying to use kafka ruby client - https://github.com/zendesk/ruby-kafka for posting logs to kafka. Below are the logs from kafka

I, [2016-08-03T17:54:38.131775 #14887]  INFO -- : Fetching cluster metadata from kafka://10.10.10.162:9092
D, [2016-08-03T17:54:38.131939 #14887] DEBUG -- : Opening connection to 10.40.50.16:9092 with client id ruby-kafka...
D, [2016-08-03T17:54:38.133199 #14887] DEBUG -- : Sending request 1 to 10.40.50.16:9092
D, [2016-08-03T17:54:38.133339 #14887] DEBUG -- : Waiting for response 1 from 10.40.50.16:9092
D, [2016-08-03T17:54:38.134763 #14887] DEBUG -- : Received response 1 from 10.40.50.16:9092
I, [2016-08-03T17:54:38.134823 #14887]  INFO -- : Discovered cluster metadata; nodes: kafka1:9092 (node_id=1), kafka2:9092 (node_id=2), kafka3:9092 (node_id=3)
D, [2016-08-03T17:54:38.134882 #14887] DEBUG -- : Closing socket to 10.40.50.16:9092
D, [2016-08-03T17:54:38.135018 #14887] DEBUG -- : Current leader for TRANSACTION_GOCARS/0 is node kafka2:9092 (node_id=2)
I, [2016-08-03T17:54:38.135092 #14887]  INFO -- : Sending 1 messages to kafka2:9092 (node_id=2)
D, [2016-08-03T17:54:38.135195 #14887] DEBUG -- : Opening connection to kafka2:9092 with client id ruby-kafka...
E, [2016-08-03T17:54:38.135750 #14887] ERROR -- : Failed to connect to kafka2:9092: getaddrinfo: Name or service not known
E, [2016-08-03T17:54:38.135825 #14887] ERROR -- : Could not connect to broker kafka2:9092 (node_id=2): getaddrinfo: Name or service not known

Does any one has any info regarding how to fix it.

user27111987
  • 995
  • 2
  • 10
  • 26
  • Possible duplicate of [UnknownHostException kafka](http://stackoverflow.com/questions/25497279/unknownhostexception-kafka) – A. Binzxxxxxx Mar 24 '17 at 09:13

2 Answers2

0

I think the error message is pretty informative in your case - kafka2 is not routable, so you should either configure connectivity so that the machine you are trying to access kafka2 from is really can reach it or change the advertised.host.name in Kafka's server.properties to expose a different address for clients

serejja
  • 22,901
  • 6
  • 64
  • 72
0

try to ping or curl the kafka2 broker in ur application, to see whether u can connect to it or not. or can u tell us the server.properties about kafka2. The host name might not be reachable.

Kevin Li
  • 2,068
  • 15
  • 27