LogStash啟動報錯:<Redis::CommandError: ERR unknown command 'script'>與batch_count 的 配置

來源:互聯網
上載者:User

標籤:cli   表示   NPU   style   sed   unknown   lis   3.2   support   

環境條件:

系統版本: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_countbatch_countValue type is numberDefault value is 125The 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'>與batch_count 的 配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.