Redis - Sample Configuration

Hi

Does any one have a sample config of Redis for distributed polling with new poller service?

Or is there a doc a person can read.

Thanks

So I got redis setup…

This is outup of redis slave server

Replication

role:slave
master_host:10.1.35.60
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
slave_repl_offset:138695
slave_priority:100
slave_read_only:1
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

This is the output of the master

Replication

role:master
connected_slaves:1
slave0:ip=10.1.35.66,port=6379,state=online,offset=144849,lag=0
master_repl_offset:144979
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2
repl_backlog_histlen:144978

The problem is now is that both servers are both masters

Any ideas

on the slave node do i need to configure and unhash the below

Distributed Polling Configuration

Once you have your redis database set up, configure it in the .env file on each node.

REDIS_HOST=10.1.35.60
#REDIS_DB=0
#REDIS_PASSWORD=
#REDIS_PORT=6379

Tried

The following on slave node and still have the same issue.

REDIS_HOST=10.1.35.60
REDIS_DB=0
#REDIS_PASSWORD=password
REDIS_PORT=6379

Has anyone got the new poller service working with distributed polling if so please share working config.

Thanks in advance

Hello!

Yes, we got it running with Redis server, although we deployed only a single-instance setup. Did not really bother with cluster at this stage. Running a couple of months now with no LibreNMS-related issues (meaning, we have problems, but they are network-related and have nothing to do with LibreNMS itself).

We also have faced multiple master instances to be present in poller cluster as reported by LibreNMS, although it does not affect production environment and I’m pretty much happy with that. We have also edited the source of poller, full story available here.

Here is our Redis config portion sample:

REDIS_HOST=10.10.10.10
REDIS_DB=0
REDIS_PASSWORD=
REDIS_PORT=6379

Do you have any issues with pollers not managing to restart polling if redis connection fails? Seem to get this consistently when trying out some failure scenarios. Wanted to check if it’s just for us :slight_smile:

Thankfully, connection to LibreNMS central node is pretty stable in our environment, but I can remember a couple of short outages in the past couple of months. I do not remember doing anything on poller nodes, when this happens: on connection outage occasions we do see “worker seconds” spike, but it resolves by itself during some time:

Alright, thanks, maybe we’ll just have to wait a bit longer then!
Just another little question, the daily updates throws some errors that memcached is not installed, even though afaik redis is instead of memcached when using the service.

I may be mistaken with this one, but validation/daily scripts were prepared before poller service upgrade and were not updated for newer Redis implementation. Honestly, we just install memcached on central and PHP extensions on poller nodes, enable the daemon on central node with 32-64M space and just leave it like that - it is never used, there are no errors on validation and we are happy with that.

Ah, I guess that’s one way of doing it :slight_smile: thanks for the input