阿里雲服務器
現象
1:查看filebeat日誌
[tomcat@iZm5e0zxx 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產生但是同樣無法消費
[tomcat@iZm6e0zbb bin]$ ./kafka-topics.sh --list --zookeeper localhost:2181 filebeat-log test
[tomcat@iZm6e0zbb 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即可
[tomcat@iZm5e0zxx bin]$ sudo vim /etc/hosts kafka-ip kafka-hostname
總結:不明白爲什麼filebeat要解析到主機名,但這樣總算可行了