logstash如何使用redis cluster

jason-寒江雪 发布于 2016/01/27 17:41
阅读 2K+
收藏 0

由于担心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>



logstash的shipper端配置:


input{
log4j {
port => 4561
type => "log4j-json-test"
}
}
output{
redis {
data_type => "list"
host => "192.168.1.153:4000"
key => "logstash_test"
}
}



报错信息:(可以看到,保存到redis失败,当我配置logstash的output host为192.168.1.153:4001的时候,是可以成功保存进去的)

[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={}, ...................



请问下谁遇到过类似的问题或者可以帮助我解决这个问题的,非常感激

加载中
0
予人wgl
予人wgl
我也碰到了,顶一下!
0
郭阿达西
郭阿达西
请问博主这个问题解决了吗?
返回顶部
顶部