Use an external Redis server

This page describes how to configure Cyberwatch to use an external Redis server instead of the one deployed as a container of the Cyberwatch instance.

Requirements

  • Have a Redis server accessible from the master node and all satellite nodes
  • Use at least version 5.13 of the orchestrator

Configuring

Creating a user

When using a dedicated Redis server, it is necessary to create a dedicated user with full privileges. By default, Cyberwatch uses a user named olympe.

These operations can be performed by executing the following commands on the Redis server:

ACL SETUSER default >password ~* &* +@all

Configuration through the base of the Cyberwatch orchestrator

Adapting the Cyberwatch configuration to the external base

You need to replace the REDIS_PASSWORD passwords with that of the dedicated user in the /etc/cyberwatch/secret.env file.

In addition, all connection information to the external Redis server can be edited in the /etc/cyberwatch/containers.env file, where it is necessary to modify:

  • the value of the REDIS_HOST field with the address of the Redis server to contact
  • the value of the REDIS_USER field with the name of the dedicated user created previously
  • the value of the REDIS_PORT field with the port number on which the Redis server can be reached

Reconfigure your instance to not use a local database

sudo cyberwatch configure --no-redis

Use appropriate options for your instance. For example, if your instance is more complex than a single node, with an external database, you need to use the command sudo cyberwatch configure --no-redis --master --no-db

Communication with the new Redis server is considered operational when the return of the sudo cyberwatch logs sidekiq command returns:

Start healthcheck server...
Watch Redis
Testing redis uri 10.10.16.63:6379
Trying to connect to redis://10.10.16.63:6379/0
Redis is up !
Watch Migration
All migration are done
Healthcheck completed reporting a successful start
Checking if Redis supports TLS
TLS not available
Using Redis URL: redis://10.10.16.63:6379/0
2023-12-08T10:05:55.352Z pid=1 tid=53x INFO: Booted Rails 7.0.8 application in production environment

Back to top