LogStash启动报错:<Redis::CommandError: ERR unknown command 'script'>与batch_count 的 配置
2018-10-01 13:42
931 查看
环境条件:
系统版本:centos 6.8
logstash版本:6.3.2
redis版本:2.4
logstash input配置:
input { redis { host => "172.16.73.33" #redis ip port => "52611" #redis 端口 password =>"123456" #redis 密码 db => 9 # 指定redis 库编号 data_type => "list" #数据类型 key => "filebeat" #key 值名称 } }View Code
问题:
1. 当我在上面的input的配置里面没有加上password参数的时候,会报下面的警告,千万不要忘记配置密码哦。
[2018-09-29T17:55:18,803][WARN ][logstash.inputs.redis ] Redis connection problem {:exception=>#<Redis::CommandError: ERR operation not permitted>}
2. 当我进行启动logstash 的时候发现有如下警告。
[2018-09-29T18:18:06,764][WARN ][logstash.inputs.redis ] Redis connection problem {:exception=>#<Redis::CommandError: ERR unknown command 'script'>}
该问题是由于我们的redis版本导致的,我们采用的redis版本是2.4版本,
官方文档这样写到:
官方文档链接:https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html#_description_31
This input will read events from a Redis instance; it supports both Redis channels and lists. The list command (BLPOP) used by Logstash is supported in Redis v1.3.1+, and the channel commands used by Logstash are found in Redis v1.3.8+. While you may be able to make these Redis versions work, the best performance and stability will be found in more recent stable versions. Versions 2.6.0+ are recommended. For more information about Redis, see http://redis.io/ batch_count note: If you use the batch_count setting, you must use a Redis version 2.6.0 or newer. Anything older does not support the operations used by batching.
虽然官方建议的是2.6版本以上,但是文档的意思我们2.4版本也还是可以使用的。我们可以知道的一点就是,batch_count 参数要使用的时候一定得在2.6版本以上,接下来我们可以再看下另外一个文档。
文档链接:https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html#plugins-inputs-redis-batch_count batch_count Value type is number Default value is 125 The number of events to return from Redis using EVAL.
这里告诉我们的是在新的版本中是已经默认加了batch_count 参数的,而且默认值为125。
这样我们就找出了我们错误的原因,要支持参数 batch_count 需要2.6版本以上。那么解决的办法有两种:
1 将redis版本升级。
2 我们不使用batch_count 参数。
由于我们这个redis里面还有其他业务,所以我们升级版本这条路就走不通了,我们决定将 batch_count 的数值设置为1 ,用来表示我们每次从redis取回一条数据,这样我们就可以正常的启动logstash了。
input { redis { host => "172.16.73.33" #redis ip port => "52611" #redis 端口 password =>"123456" #redis 密码 db => 9 # 指定redis 库编号 batch_count => 1 # 这个默认值125,我们需要设置为1以支持redis2.6以下的版本。 data_type => "list" #数据类型 key => "filebeat" #key 值名称 } }
以上就是我在使用logstash 遇到的问题 以及解决的办法。希望能对你有些帮助。
相关文章推荐
- LogStash启动报错:<Redis::CommandError: ERR unknown command 'script'>
- redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'PSETEX'
- linux(centos)上配置nginx、mysql、php-fpm、redis开机启动<转>
- laravel 5.4 redis 报错 'Predis\Response\ServerException' with message 'ERR unknown command 'EVAL'' 201
- redis 安装启动及设置密码<windows>
- php-fpm 启动参数及重要配置详解<转>
- redis 安装启动及设置密码<windows>
- bug-解决-springMVC框架 启动tomcat时 (at org.springframework.asm.ClassReader.<init>(Unknown Source))问题
- redis 安装启动及设置密码<windows>
- redis 安装启动及设置密码<windows>
- Redis内存配置参数<maxmemory>
- spring配置文件加<aop:aspectj-autoproxy/>后无法启动listener【解决方案】
- redis 集群启动报错:ERR Invalid node address specified: node-200:7200 (Redis::CommandError)
- redis练习手册<三>redis的配置文件redis.conf介绍
- mac spring redis环境配置<一>
- error C2265: '<Unknown>' : reference to a zero-sized array is illegal
- web.xml文件加载顺序 一、 1 、启动一个 WEB 项目的时候, WEB 容器会去读取它的配置文件 web.xml ,读取 <listener> 和 <context-param>
- \sdk\include\wspiapi.h(47) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal 解决方案
- elasticsearch修改配置文件后启动提示nested: ParserException[expected '<document start>', but found BlockMappingS
- 'operator =' must be a <Unknown> member