环境条件:

系统版本:centos 6.8

logstash版本:6.3.2

redis版本:2.4

logstash  input配置:

input {
redis {
host => "172.16.73.33" #redis ip
port => "" #redis 端口
password =>"" #redis 密码
db =>           # 指定redis 库编号
data_type => "list" #数据类型
key => "filebeat" #key 值名称
   }
}

问题:

  1.  当我在上面的input的配置里面没有加上password参数的时候,会报下面的警告,千万不要忘记配置密码哦。

[--29T17::,][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.+ 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. 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
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 => "" #redis 端口
password =>"" #redis 密码
db =>           # 指定redis 库编号
batch_count =>      # 这个默认值125,我们需要设置为1以支持redis2.6以下的版本。
data_type => "list" #数据类型
key => "filebeat" #key 值名称
   }
}

以上就是我在使用logstash 遇到的问题 以及解决的办法。希望能对你有些帮助。

LogStash启动报错:<Redis::CommandError: ERR unknown command 'script'>与batch_count 的 配置的更多相关文章

  1. appnium启动报错Encountered internal error running command: Error: Error occured while starting App. Original error: Permission to start activity denied.

    说明写错了activity 首先查看一下activity,使用命令 打开被测app,输入命令adb shell dumpsys window | findstr mCurrentFocus 看似这个a ...

  2. Spring session redis ERR unknown command 'CONFIG'

    部署线上服务启动报错 redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CONFIG' Redis CON ...

  3. Windows 7 上面 redis 启动报错的处理

    Windows 7或者是 win10 上面 安装redis 的windows 3.2.100 的版本 启动报错: Creating Server TCP listening socket *:: li ...

  4. selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

    前面讲了工程启动报错“selenium启动报错Unable to read VR Path Registry from C:\Users\clinva\AppData\Local\openvr\ope ...

  5. redis启动报错:Fatal error loading the DB: Invalid argument

    redis启动报错 add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be ...

  6. undo丢失恢复异常恢复,运维DBA反映Oracle数据库无法启动报错ORA-01157 ORA-01110,分析原因为Oracle数据库坏块导致

    本文转自 惜纷飞 大师. 模拟基表事务未提交数据库crash,undo丢失恢复异常恢复,运维DBA反映Oracle数据库无法启动报错ORA-01157 ORA-01110,分析原因为Oracle数据库 ...

  7. logstash 启动报找不主类或无法加载 java

    logstash 启动报无法找到主类解决方案 Zparkle 关注 2018.03.08 22:04* 字数 2051 阅读 1评论 0喜欢 0 当logstash启动时,首先要注意正确配置java ...

  8. Celery 启动报错 can_read() got an unexpected keyword argument timeout

    问题: Celery 启动报错 can_read() got an unexpected keyword argument timeout 方案:更改redis版本和celery版本,我使用下面的ce ...

  9. Tomcat7.0.40注册到服务启动报错error Code 1 +connector attribute sslcertificateFile must be defined when using ssl with apr

    Tomcat7.0.40 注册到服务启动遇到以下几个问题: 1.启动报错errorCode1 查看日志如下图: 解决办法: 这个是因为我的jdk版本问题,因为电脑是64位,安装的jdk是32位的所以会 ...

随机推荐

  1. 【转】WinRT 中SystemTrigger 构造函数的 SystemTriggerType 参数的解释

    中文版:http://msdn.microsoft.com/library/windows/apps/windows.applicationmodel.background.systemtrigger ...

  2. Python学习-27.Python中的列表(list)

    列表已经用了很多次了.使用中括号包含元素. list = ['a','b','c'] 获取元素使用[]. print(list[0]) 输出a 不过值得注意的是,[]只能是0到元素个数-1吗?在Pyt ...

  3. 一、配置etcd数据库

      etcd服务作为Kubernetes集群的主数据库,在安装Kubernetes各服务之前需要首先安装和启动. 1. 安装etcd yum -y install etcd 2. 修改etcd配置文件 ...

  4. 浏览器拦截跨域请求处理方法(同源策略不允许读取XXX上的远程资源)

    直接了当了说,解决此类问题,最直接的方法就是,就是给被请求的服务器,添加HTTP头响应头,这里提供两种添加HTTP头的方法: 第一种,就是在程序中添加HTTP头: Response.AddHeader ...

  5. 解决EF没有生成字段和表说明

    找了很多资料,终于找到一篇真正能解决ef生成字段说明,注释的文章,收藏不了,于是转载 本文章为转载,原文地址 项目中使用了EF框架,使用的是Database-First方式,因为数据库已经存在,所以采 ...

  6. winform中控件的简单数据绑定

    是因为在学习组件开发过程中有个Bindable的属性,不明白意义,然后才接触到winform的数据绑定,想着先把数据绑定这块看一下,然后去测试下是否Bindable属性设为false,就不能绑定该属性 ...

  7. 如何: 在 VS中的设计时刻主从表绑定控件到数据库

    这个示例展示了如何在 Visual Studio 2005 的设计时刻,把一个 data-aware 控件 (XtraGrid.XtraPivotGrid.XtraVerticalGrid 等) 绑定 ...

  8. Monotone and Sorted Matrix Search ( Arithmetic and Algebra) CGAL 4.13 -User Manual

    monotone_matrix_search() and sorted_matrix_search() are techniques that deal with the problem of eff ...

  9. RabbitMQ之消息持久化(转)

    原文地址 https://blog.csdn.net/u013256816/article/details/60875666/ 消息的可靠性是RabbitMQ的一大特色,那么RabbitMQ是如何保证 ...

  10. Android 日常总结的一些方法使用

    1. setImageResource : 更改图片的资源 2. setClickable :  设置为true时,表明控件可以点击,如果为false,就不能点击 .  注意,setOnClickLi ...