在Linux中安装好kafka后,消费数据时如果报错:java.net.UnknownHostException xxxx.xxxx.xxxx

此时,原因主要是主机名和地址不对应造成。

解决方法:

在/etc/hosts文件中配置中加上:安装有kafka集群的3台机器的IP地址和主机名。例如:

172.26.xxx.xxx hostname1

172.26.xxx.xxx hostname2

172.26.xxx.xxx hostname3

(附加:查看host名称的命令 —— hostname 即可)

#

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-01-25
  • 2021-09-21
  • 2021-11-20
猜你喜欢
  • 2021-11-20
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-07-17
  • 2021-11-02
相关资源
相似解决方案