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.
- java.net.UnknownHostException: Macula: Macula: nodename nor servname provided, or not known at java.net.InetAddress.getLocalHost(InetAddress.java:1473) Caused by: java.net.UnknownHostException: Macula: nodename nor servname provided, or not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293) at java.net.InetAddress.getLocalHost(InetAddress.java:1469)