fsfss21 发表于 2017-3-6 09:20:39

filebeat到kafka日志无法传输

阿里云服务器

现象
1:查看filebeat日志

1
$ tail -n 20 /var/log/filebeat/filebeat




2017-03-01T14:52:25+08:00 WARN producer/broker/0 state change to because dial tcp: lookup iZm5e0zxx on 10.2xx.xx.x1x:53: no such host

2:另外一台服务器可以看到有topic产生但是同样无法消费

1
2
3
$ ./kafka-topics.sh --list --zookeeper localhost:2181
filebeat-log
test





1
2
$ ./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 instead of .




说明:如果日志传输成功,上述命令会有日志输出
第二个应该不属于报错,应该是版本警告。

解决办法:
在filebeat端修改hosts即可

1
2
$ sudo vim /etc/hosts
kafka-ip    kafka-hostname





总结:不明白为什么filebeat要解析到主机名,但这样总算可行了

页: [1]
查看完整版本: filebeat到kafka日志无法传输