This document will give you some guidance on optimising your setup.
The suggestions are in a rough order of how much impact they will have.
[titreyoyo]RRDCached[/titreyoyo]
We absolutely recommend running this, it will save on IO load. RRDCached
[titreyoyo]Setting up RRDCached[/titreyoyo]
This document will explain how to set up RRDCached for LibreNMS.
Since version 1.5, rrdtool / rrdcached now supports creating rrd files over rrdcached. If you have rrdcached 1.5.5 or above, you can also tune over rrdcached. To enable this set the following config:
This setting has to be the exact version of rrdtool you are running.
NOTE: This feature requires your client version of rrdtool to be 1.5.5 or newer, in addition to your rrdcached version.
[titreyoyo]Distributed Poller Support Matrix[/titreyoyo]
Shared FS: Is a shared filesystem required?
Features: Supported features in the version indicated.
The suggestions are in a rough order of how much impact they will have.
[titreyoyo]RRDCached[/titreyoyo]
We absolutely recommend running this, it will save on IO load. RRDCached
[titreyoyo]Setting up RRDCached[/titreyoyo]
This document will explain how to set up RRDCached for LibreNMS.
Since version 1.5, rrdtool / rrdcached now supports creating rrd files over rrdcached. If you have rrdcached 1.5.5 or above, you can also tune over rrdcached. To enable this set the following config:
Code :
$config['rrdtool_version'] = '1.5.5';
NOTE: This feature requires your client version of rrdtool to be 1.5.5 or newer, in addition to your rrdcached version.
[titreyoyo]Distributed Poller Support Matrix[/titreyoyo]
Shared FS: Is a shared filesystem required?
Features: Supported features in the version indicated.
Code :
G = Graphs.
C = Create RRD files.
U = Update RRD files.
T = Tune RRD files.
[titreyoyo]RRDCached installation Debian Buster[/titreyoyo]
(rrdcached 1.7.1)
1: Install rrdcached
2: Editer le fichier
to include:
3: Fix permissions
4: Restart the rrdcached service
5: Edit /opt/librenms/config.php to include:
For local RRDCached server
(rrdcached 1.7.1)
1: Install rrdcached
Code :
sudo apt-get install rrdcached
Code :
nano /etc/default/rrdcached
Code :
DAEMON=/usr/bin/rrdcached
WRITE_TIMEOUT=1800
WRITE_JITTER=1800
WRITE_THREADS=4
BASE_PATH=/opt/librenms/rrd/
JOURNAL_PATH=/var/lib/rrdcached/journal/
PIDFILE=/var/run/rrdcached.pid
SOCKFILE=/run/rrdcached.sock
SOCKGROUP=librenms
DAEMON_GROUP=librenms
DAEMON_USER=librenms
BASE_OPTIONS="-B -F -R"
Code :
chown librenms:librenms /var/lib/rrdcached/journal/
Code :
systemctl restart rrdcached.service
Code :
nano /opt/librenms/config.php
For local RRDCached server
Code :
$config['rrdcached'] = "unix:/run/rrdcached.sock";
For remote RRDCached server make sure you have network option in /var/default/rrdcached
Code :
NETWORK_OPTIONS="-L"
Code :
$config['rrdcached'] = "IPADDRESS:42217";
NOTE: change IPADDRESS to the ip the rrdcached server is listening on.
[titreyoyo]Verify[/titreyoyo]
Check to see if the graphs are being drawn in LibreNMS. This might take a few minutes. After at least one poll cycle (5 mins), check the LibreNMS disk I/O performance delta. Disk I/O can be found under the menu Devices>All Devices>localhost hostname>Health>Disk I/O.
Depending on many factors, you should see the Ops/sec drop by ~30-40%.
[titreyoyo]Securing RRCached[/titreyoyo]
According to the man page, under "SECURITY CONSIDERATIONS", rrdcached has no authentication or security except for running under a unix socket. If you choose to use a network socket instead of a unix socket, you will need to secure your rrdcached installation. To do so you can proxy rrdcached using nginx to allow only specific IPs to connect.
Using the same setup above, using nginx version 1.9.0 or later, you can follow this setup to proxy the default rrdcached port to the local unix socket.
(You can use ./conf.d for your configuration as well)
add the following to your nginx.conf file:
Add this to /etc/nginx/streams-available/rrd
Replace $LibreNMS_IP with the ip of the server that will be using rrdcached. You can specify more than one allow statement. This will bind nginx to TCP 42217 (the default rrdcached port), allow the specified IPs to connect, and deny all others.
next, we'll symlink the config to streams-enabled:
and reload nginx
Depending on many factors, you should see the Ops/sec drop by ~30-40%.
[titreyoyo]Securing RRCached[/titreyoyo]
According to the man page, under "SECURITY CONSIDERATIONS", rrdcached has no authentication or security except for running under a unix socket. If you choose to use a network socket instead of a unix socket, you will need to secure your rrdcached installation. To do so you can proxy rrdcached using nginx to allow only specific IPs to connect.
Using the same setup above, using nginx version 1.9.0 or later, you can follow this setup to proxy the default rrdcached port to the local unix socket.
(You can use ./conf.d for your configuration as well)
Code :
mkdir /etc/nginx/streams-{available,enabled}
Code :
#/etc/nginx/nginx.conf
...
stream {
include /etc/nginx/streams-enabled/*;
}
Code :
server {
listen 42217;
error_log /var/log/nginx/rrd.stream.error.log;
allow $LibreNMS_IP;
deny all;
proxy_pass unix:/run/rrdcached.sock;
}
next, we'll symlink the config to streams-enabled:
Code :
ln -s /etc/nginx/streams-{available,enabled}/rrd
Code :
service nginx reload
Source de l'information : https://docs.librenms.org/Extensions/RRD...#rrdcached
