java.net.UnknownHostException

tip

When kafka creates new consumers, it simply concatenate the name of your VM to generate the consumer id. So, your VM resolves localhost as the name of your VM, not whatever you had set. To solve, add kafka(or the name of VM) plus address to /etc/hosts

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • UnknownHostException kafka
    via Stack Overflow by noplay
    ,
  • Failed to get local hostname
    via GitHub by restart916
    ,
  • Unable to bind to 0.0.0.0 inside AWS VPC
    via Stack Overflow by LizH
    ,
    • java.net.UnknownHostException: vagrant-centos65.vagrantup.com: vagrant-centos65.vagrantup.com: Name or service not known at java.net.InetAddress.getLocalHost(InetAddress.java:1473)

    Users with the same issue

    Unknown visitor1 times, last one,
    raj76
    2 times, last one,
    nasimk
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    9 more bugmates