Environmental conditions:
System version: CentOS 6.8
Logstash version: 6.3.2
Redis Version: 2.4
Logstash input configuration:
Input {
Redis {
Host => "172.16.73.33" #redis ip
Port => "52611" #redis port
Password =>"123456" #redis password
Db => 9 # Specify the redis library number
Data_type => "list" #data type
Key => "filebeat" #key value name
}
}
View CodeProblem:
1. When I do not add the password parameter in the above input configuration, will report the following warning, do not forget to configure the password Oh .
[2018--29t17: +:803] [WARN] [Logstash.inputs.redis ] Redis connection problem {: Exception=>#<redis::commanderror:err operation not Permitted>}
2. When I start Logstash, I find the following warning.
[2018-09-29t18:18:06,764] [WARN] [Logstash.inputs.redis] Redis connection problem {: Exception=>#<redis::commanderror:err unknown command ' script ';}
This issue is due to our version of Redis, which is the version 2.4 that we are using.
The official documentation reads:
Official Document Link: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html#_description_31
This input would read events from a Redis instance; It supports both Redis channels and lists. The List command (Blpop) used by Logstash is supportedinchRedis v1.3.1+, and the channel commands used by Logstash is foundinchRedis v1.3.8+. While the able to MakeThese Redis versions work, the best performance and stability'll be foundinch MoreRecent stable versions. Versions2.6.0+is recommended. for MoreInformation about Redis, see http://redis.io/Batch_count note:if You use the Batch_count setting and you must use a Redis version2.6.0or newer. Anything older does not a support for the operations used by batching.
Although the official recommendation is more than 2.6 version, but the meaning of the document of our 2.4 version is also available. One thing we can tell is that the Batch_count parameter must be in the 2.6 version above, and then we can look at another document.
Document Link: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html# Plugins-inputs-redis-batch_countThe number ofevents to return from Redis using EVAL.
This tells us that the Batch_count parameter has been added by default in the new version, and the default value is 125.
So we can find out the reason why we are wrong, to support the parameter Batch_count need 2.6 version above. There are two ways to solve it:
1 Upgrade the Redis version.
2 We do not use the Batch_count parameter.
Because we have other business in this redis, so we have to upgrade the version of the road will not go through, we decided to set the value of Batch_count to 1, to indicate that we retrieve a piece of data from Redis, so that we can start the normal logstash.
Input {
Redis {
Host => "172.16.73.33" #redis ip
Port => "52611" #redis port
Password =>"123456" #redis password
Db => 9 # Specify the redis library number
Batch_count => 1 # This default value is 125. We need to set it to 1 to support versions below redis2.6.
Data_type => "list" #data type
Key => "filebeat" #key value name
}
}
These are the problems I encountered in using Logstash and the solutions. I hope to be of some help to you.
Logstash start error: <redis::commanderror:err unknown command ' script ' > Configuration with Batch_count