Table of Contents

Redis

General Information

Redis is “an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.”

Official Site: https://redis.io/

Checklist


Server: Install

Install/enable the EPEL repo.


Install redis

yum install redis


Start and Enable

systemctl enable redis
systemctl start redis


Verify service is available locally

[root@server01 ~]# redis-cli
127.0.0.1:6379> exit

Server: Configure

Different Redis server options to configure that are not defaults.


The config file is located at: /etc/redis.conf


Bind Interface

The default bind/listen interface is localhost (127.0.0.1).

If you would like clients to be able to connect over the network, you will need to change this.


Change the bind interface

bind 192.168.1.100

Security

Redis was designed to be deployed on trusted networks. It is recommended to NOT expose Redis to the internet.

That being said, there are some protection measures that can be taken.


Firewall


Authentication (password) for clients


Disable Certain Commands


Encryption Tunneling


General

Daemonize

Supervisor Interaction

Append Log

File Sync


Client: Install

Install the Python Redis client

pip install redis

Client: Configure

Import the Redis module and connect to the Redis server

import redis
 
redis_db.keys()
 
redis_db = redis.StrictRedis(host="192.168.1.151", port=6379, db=0, password="c5bdeb2b550e038740466ec0c8dc03df3e8bb629bde539251840da1af6ee62d2")


Example Client Use