logstash如何使用redis cluster
由于担心redis单机挂掉导致logstash,参考了:http://www.tuicool.com/articles/EVzEZzn 搭建了redis的cluster集群, 端口分别为 4000、4001、4002,logstash的shipper端发送的key被哈希到4001这台服务器上,按照文章的说明,无论我shipper连接三个端口中的任何一个,都应该是可以将日志信息发送到这个集群上,但是当我配置的地址是4000的时候,会报错,详细信息如下:
redis信息:(可以看到,集群配置好了,往4000插入数据,自动插入到了4001)
[root@localhost src]# ./redis-trib.rb info 192.168.1.153:4000 192.168.1.153:4000 (4c017302...) -> 0 keys | 5461 slots | 0 slaves. 192.168.1.153:4002 (12b14519...) -> 1 keys | 5461 slots | 0 slaves. 192.168.1.153:4001 (59ca7fa9...) -> 0 keys | 5462 slots | 0 slaves. [OK] 1 keys in 3 masters. 0.00 keys per slot on average. [root@localhost src]# redis-cli -c -p 4000 127.0.0.1:4000> set "test" "test" -> Redirected to slot [6918] located at 192.168.1.153:4001 OK 192.168.1.153:4001> set "abc" "abc" OK 192.168.1.153:4001> set "hello" "world" -> Redirected to slot [866] located at 192.168.1.153:4000 OK 192.168.1.153:4000>
input{ log4j { port => 4561 type => "log4j-json-test" } } output{ redis { data_type => "list" host => "192.168.1.153:4000" key => "logstash_test" } }
[jason@localhost logstash]$ ./logstash-2.1.1/bin/logstash agent -f conf/client1.conf Settings: Default filter workers: 2 Logstash startup completed Failed to send event to Redis {:event=>#@metadata={}, ...................
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请问博主这个问题解决了吗?
我也碰到了,顶一下!