UnknownHostException kafka

后端 未结 2 471
耶瑟儿~
耶瑟儿~ 2021-02-05 10:01

I am trying to setup a Kafka cluster (the first node in the cluster actually).

I have a single node zookeeper cluster setup. I am setting up kafka on a separate node.

2条回答
  •  名媛妹妹
    2021-02-05 11:00

    As noplay pointed out the issue was that Kafka wasn't able to resolve the correct IP, this may happen for example on you EC2 instances running in private subnets without assignment of public IP. The solution summarized:

    hostname
    

    Which will show you the host name, something like ip-10-180-128-217. Then just update your /etc/hosts

    sudo nano /etc/hosts
    

    edit, e.g.

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ip-10-180-128-217
    

提交回复
热议问题