How do I install the 'collectd' Redis plugin on Amazon Linux 2?

368 Views Asked by At

How do I install the 'collectd' Redis plugin on Amazon Linux 2?

When I run yum list | grep collectd, I do not see Redis. How do I install the Redis plugin for 'collectd'?

2

There are 2 best solutions below

0
Deepak Kumar On BEST ANSWER

The redis plugin for collectd may not be available in the default repositories. You can try adding the EPEL repository and then installing the plugin using the following steps:

  1. Install the EPEL repository:
sudo amazon-linux-extras install epel
  1. Install collectd and the redis plugin:
sudo yum install collectd collectd-redis
  1. Configure the redis plugin by editing the collectd configuration file:
sudo vi /etc/collectd.conf

Add the following lines to the file:

LoadPlugin redis
<Plugin redis>
  <Node "mynode">
    Host "localhost"
    Port "6379"
    Redis_version 5
    Redis_key "myrediskey"
    Redis_field "myredisfield"
  </Node>
</Plugin>
  1. Restart the collectd service:
sudo systemctl restart collectd

Note: Make sure that redis is already installed and running on your system before attempting to install and configure the collectd plugin.

0
Jack Smith On

First of all, you need to install Collectd. To do so, enter the following command:

sudo yum install collectd

After that, you need to install Redis:

sudo yum install redis

Install the Redis plugin for Collectd:

sudo yum install collectd-redis

Edit the Collectd configuration file /etc/collectd.conf and add the following lines to the bottom of the file:

LoadPlugin redis

<Plugin redis>
  <Node "redis">
    Host "localhost"
    Port "6379"
  </Node>
</Plugin>

This will configure Collectd to monitor the Redis instance running on the local host.

And all you have to do now is restart the Collectd service to apply the changes you made to the configuration file using the following command:

sudo systemctl restart collectd

That covers it.