# Logstash with redis cluster problem

**URL:** <https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002>\
**Category:** Logstash\
**Created:** [January 25, 2016, 8:38am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002 "2016-01-25T08:38:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuzg459](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@liuzg459](https://discuss.elastic.co/u/liuzg459)\
**Post date:** [January 25, 2016, 8:38am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/1 "2016-01-25T08:38:59Z")

</div>

Hi there! I want to use redis cluster instant of one instance. here is my framework：  
logstash shipper -\>redis cluster -\> logstash indexer -\> elasticsearch -\> kibana

Here is my redis config:

> [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\>

Here is my logstash shipper config:

> input{  
> log4j {  
> port =\> 4561  
> type =\> "log4j-json-test"  
> }  
> }  
> output{  
> redis {  
> data\_type =\> "list"  
> host =\> "192.168.1.153:4000"  
> key =\> "logstash\_test"  
> }  
> }

Here is my logstash indexer config:

> input{  
> redis{  
> host =\> "192.168.1.153"  
> port =\> 4000  
> key =\> "logstash\_test"  
> data\_type =\> "list"  
> }  
> }  
> output{  
> elasticsearch {  
> hosts =\> "192.168.1.153"  
> }  
> }

Here is the logstash shipper error log:

> [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=\>#\<LogStash::Event:0x1c747a72 @metadata={}, ...................

Here is the logstash indexer error log(I think the resason is not the same with shipper error):

> Redis connection problem {:exception=\>#\<Redis::CommandError: CROSSSLOT Keys in request don't hash to the same slot\>, :level=\>:warn}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 25, 2016, 8:53am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/2 "2016-01-25T08:53:36Z")

</div>

I'd put the port number in quotes.

---

<div class="post-metadata">

**Author:** ![liuzg459](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@liuzg459](https://discuss.elastic.co/u/liuzg459)\
**Post date:** [January 25, 2016, 9:26am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/3 "2016-01-25T09:26:01Z")

</div>

Negtive,I tried,but it make no differents

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 25, 2016, 10:11am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/4 "2016-01-25T10:11:49Z")

</div>

Can you telnet from the indexer to redis?

---

<div class="post-metadata">

**Author:** ![liuzg459](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@liuzg459](https://discuss.elastic.co/u/liuzg459)\
**Post date:** [January 25, 2016, 10:28am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/5 "2016-01-25T10:28:04Z")

</div>

Ofcourse,they are on the same server.

I suspect that the configuration was not correct.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:14am UTC](https://discuss.elastic.co/t/logstash-with-redis-cluster-problem/40002/6 "2017-07-06T05:14:30Z")

</div>


