阿里云服务器
现象
1:查看filebeat日志
[[email protected] bin]$ tail -n 20 /var/log/filebeat/filebeat
2017-03-01T14:52:25+08:00 WARN producer/broker/0 state change to [closing] because dial tcp: lookup iZm5e0zxx on 10.2xx.xx.x1x:53: no such host
2:另外一台服务器可以看到有topic产生但是同样无法消费
[[email protected] bin]$ ./kafka-topics.sh --list --zookeeper localhost:2181 filebeat-log test
[[email protected] bin]$ ./kafka-console-consumer.sh --zookeeper localhost:2181 --topic filebeat-log Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
说明:如果日志传输成功,上述命令会有日志输出
第二个应该不属于报错,应该是版本警告。
解决办法:
在filebeat端修改hosts即可
[[email protected] bin]$ sudo vim /etc/hosts kafka-ip kafka-hostname
总结:不明白为什么filebeat要解析到主机名,但这样总算可行了
时间: 2024-11-21 02:51:06