我之前使用elk+redis+filebeat搭建了日志平台,现在将redis替换成codis之后,logstash报错:
# [2020-06-18T11:20:54,146][WARN ][logstash.inputs.redis] Redis connection problem {:exception=>#<Redis::CommandError: ERR handle request, command'BLPOP' is not allowed>}
# [2020-06-18T11:19:12,920][WARN ][logstash.inputs.redis] Redis connection problem {:exception=>#<Redis::CommandError: ERR max number of clients reached>}strong text
这是我的 logstash 配置:
/usr/local/elk/logstash/config/logstash_es.conf
input {
redis {
data_type => "list"
key => "elk"
host => "192.168.124.224"
port => "19000"
batch_count => "1"
threads => 5
codec => "json"
}
}
output {
if [fields][log_type] == "php" {
elasticsearch {
hosts => ["192.168.124.225:9200"]
index => "php-%{+YYYY.MM.dd}"
action => "index"
}
}
}
答案1
Codis 提到它们与 twemproxy 100% 兼容。根据 twemproxy 文档该BLPOP
命令不受支持。因为logstash Redis 输入插件描述BLPOP
为必需功能,这告诉我 Codis 根本不能与 Logstash 一起使用。