Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access kafka by server IP address #171

Closed
paperage opened this issue May 13, 2014 · 4 comments
Closed

Can't access kafka by server IP address #171

paperage opened this issue May 13, 2014 · 4 comments

Comments

@paperage
Copy link

I'm new to kafka and when I use kafka-python to access kafka by

client = KafkaClient("localhost:9092") or client = KafkaClient("127.0.0.1:9092").

Both of the 2 ways can access kafka, but when I use the ip of the server like

client = KafkaClient("10.255.208.34:9092") on the server and other machines

they can not access kafka. Why can i use the ip address?

Thanks!

now i can access the server i setup for test, but i still can't access the kafka cluster

No handlers could be found for logger "kafka"
Traceback (most recent call last):
File "cons.py", line 5, in
kafka = KafkaClient("10.4.32.221:9092")
File "/usr/local/lib/python2.7/site-packages/kafka_python-0.9.1-py2.7.egg/kafka/client.py", line 41, in init
self.load_metadata_for_topics() # bootstrap with all metadata
File "/usr/local/lib/python2.7/site-packages/kafka_python-0.9.1-py2.7.egg/kafka/client.py", line 243, in load_metadata_for_topics
response = self._send_broker_unaware_request(request_id, request)
File "/usr/local/lib/python2.7/site-packages/kafka_python-0.9.1-py2.7.egg/kafka/client.py", line 101, in _send_broker_unaware_request
raise KafkaUnavailableError("All servers failed to process request")
kafka.common.KafkaUnavailableError: All servers failed to process request

@dpkp
Copy link
Owner

dpkp commented May 13, 2014

Sounds like your server is bound to localhost. Try leaving host.name empty in server.properties.

@paperage
Copy link
Author

Thanks a lot!
host.name in server.properties was empty

And i still can't access the kafka cluster with the same error but can access kafka on my test machine in the same way except changing the IP address and topic name only ...
:(

@paperage
Copy link
Author

I use kafka's kafka-console-consumer.sh to access the cluster by

bin/kafka-console-consumer.sh --zookeeper 10.4.32.221:2181 --topic test --from-beginning

and the errors :

[2014-05-13 15:12:33,683] ERROR Error processing message, stopping consumer: (kafka.consumer.ConsoleConsumer$)
kafka.common.ConsumerRebalanceFailedException: console-consumer-60631_h253017-1399965145213-a21782c1 can't rebalance after 4 retries
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:432)
at kafka.consumer.ZookeeperConsumerConnector.kafka$consumer$ZookeeperConsumerConnector$$reinitializeConsumer(ZookeeperConsumerConnector.scala:722)
at kafka.consumer.ZookeeperConsumerConnector$WildcardStreamsHandler.(ZookeeperConsumerConnector.scala:756)
at kafka.consumer.ZookeeperConsumerConnector.createMessageStreamsByFilter(ZookeeperConsumerConnector.scala:145)
at kafka.consumer.ConsoleConsumer$.main(ConsoleConsumer.scala:196)
at kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)
Consumed 0 messages

What reason can cause "can't rebalance after 4 retries"?
Thanks!! :)

@dpkp
Copy link
Owner

dpkp commented May 15, 2014

non-python specific issues should be directed to the main kafka mailing lists: https://kafka.apache.org/contact.html

@dpkp dpkp closed this as completed May 15, 2014
wbarnha added a commit to mkromer-tc/kafka-python that referenced this issue Mar 18, 2024
bradenneal1 pushed a commit to bradenneal1/kafka-python that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants