Closed hustshawn closed 5 years ago
Hi @hustshawn, can you please reply the following questions?
I think Kafka requires to be accessed using the hostname configured with the KAFKA_ADVERTISED_LISTENERS env var. In your case that is bnm-kafka-headless.bitnami-kafka:9092
.
Hi @tompizmor , thanks for help.
Do you have two different deployments of kafka? One on EC2 that is working and other somewhere else that is not.
Yes.
How did you deploy the charts?
I installed with helm by running helm install --name bnm-kafka bitnami/kafka --namespace=bitnami-kafka
Did you modify any of the default values?
No.
Which address are you using to connect to the Kafka deployed on EC2?
Used a DNS name with port simply like kafka.myhost.com.hk:9092
I think Kafka requires to be accessed using the hostname configured with the KAFKA_ADVERTISED_LISTENERS env var. In your case that is bnm-kafka-headless.bitnami-kafka:9092.
Actually, I was just developing some application, and I just run my Python script on my local machine, so the script is outside of the Kube cluster. That's why I used the port-forward
to make it accessible from my local host. I think the connection string bnm-kafka-headless.bitnami-kafka:9092
is only available if I want access the kafka inside the Kube cluster.
I think the connection string bnm-kafka-headless.bitnami-kafka:9092 is only available if I want access the kafka inside the Kube cluster.
Yes, that is correct. However, you could do a trick in the /etc/hosts
file. If you add the following line I think it can work:
127.0.0.1 bnm-kafka-headless.bitnami-kafka
@tompizmor It works now. Thank you.
I am glad it worked! 🙂
Hi,
I followed the instruction
, but unable to connect from my local client with this address.
A sample python code looks like this
and I got the error below
The same code actually run well if Kafka deployed on an EC2 instance.
Any idea about this issue? or where I am getting wrong