REDIS Module : harvester/registry.go:83 Error running input: error receiving slowlog data: dial tcp 127.0.0.1:6379

Hi,

just try the Redis module on a Redis server but receives error message when start:
filebeat -e --modules system,redis

The message in the console is the following:
ERROR harvester/registry.go:83 Error running input: error receiving slowlog data: dial tcp 127.0.0.1:6379: getsockopt: connection refused

Also in the config file of the Redis module: modules.d/redis.yml
we have set the follwoing config:

  • module: redis

    Main logs

    log:
    enabled: true

    Set custom paths for the log files. If left empty,

    Filebeat will choose the paths depending on your OS.

    var.paths: ["/var/log/redis/*.log"]

    Slow logs, retrieved via the Redis API (SLOWLOG)

    slowlog:
    enabled: false

    The Redis hosts to connect to.

    #var.hosts: ["t:6379"]
    #var.hosts: ["poc-pex-redis-02:6379"]
    var.hosts: ["poc-pex-redis-02:6979","poc-pex-redis-02:26979"]

    Optional, the password to use when connecting to Redis.

    var.password: "xxxxxx"

--> multiple Redis that don't list to localhost as access remotely. So why the message localhost:6379 ?
Why does it try to access the localhost and not the IP or hostname set ?

Also with Redis you can you Sentinel that provide load balacing and automatic switch over of the Mastet/Slave. Shoudl Sentinel not be also supported ?

Regards,

What version of Filebeat are you using?

filebeat version 6.3.2

2 Redis instances running on the same server:
redis_01 on port 6379
redis_02 on port 26379

1 is the Master and the second is the slave (replication).

The connection to the instance works from the redis server and from any remote server that require to access the Redis instances.

redis-cli -h poc-pex-redis-02 -p 26379 -a xxxxxx INFO | grep -i master
role:master
master_repl_offset:19099124

redis-cli -h poc-pex-redis-02 -p 26379 -a xxxxxx INFO | grep -i slave
connected_slaves:1
slave0:ip=10.0.193.56,port=6379,state=online,offset=19097814,lag=1

It is also protected by a password. If not set during access, connection is rejected and no data is send as response.

Also for HA we have set Sentinel that monitor Redis instance and response to any request the IP of the master.

In the Redis module config file:

  • module: redis

    Main logs

    log:
    enabled: true

    Set custom paths for the log files. If left empty,

    Filebeat will choose the paths depending on your OS.

    var.paths: ["/var/log/redis/*.log"]

    Slow logs, retrieved via the Redis API (SLOWLOG)

    slowlog:
    enabled: false

    The Redis hosts to connect to.

    #var.hosts: ["t:6379"]
    #var.hosts: ["poc-pex-redis-02:6379"]
    var.hosts: ["poc-pex-redis-02:6979","poc-pex-redis-02:26979"]

    Optional, the password to use when connecting to Redis.

    var.password: "xxxxxx"

The redis module should only use var.hosts for the slowlog fileset. It should not use it for the log fileset. So that fact that it's even trying to connect to 127.0.0.1:6379 is odd.

Could you post the entire log from the moment you start running filebeat, please (not just the error line)?

Also, could you post your complete filebeat.yml and re-post your complete modules.d/redis.yml. For each of these files, when you post them here, please wrap the contents in ``` and ``` so the formatting of the files is preserved exactly as it is on your machine.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.