Skip to content

Can't access kafka by server IP address #171

Closed
@paperage

Description

@paperage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions