Redis Sentinel Estimated Reading Time: 2 Minutes Note: This functionality requires Ubersmith 5.1 or newer. Redis Sentinel Overview Redis Sentinel is a system that provides high availability for Redis. The key benefits of using Sentinel are: Automatic Failover: If your master Redis server goes down, Sentinel will automatically detect the failure, promote one of the replicas to be the new master, and reconfigure the other replicas to follow the new master. This minimizes downtime without manual intervention. Monitoring: Sentinel constantly monitors your master and replica instances to ensure they are working correctly. Notifications: Sentinel can be configured to alert you or your systems when there's an issue with any of your Redis instances. In short, Sentinel adds a layer of robustness to a standard Redis master-replica setup by automating the process of failure detection and recovery. Ubersmith supports the use of Redis Sentinel to provide high availability (HA) for the redis-data containers, which are used to store Ubersmith plugin and other system data. Ubersmith Configuration To configure Ubersmith to use Redis Sentinel, you will need to set several environment variables in your Docker Compose configuration. Deploy Redis Sentinel First, ensure you have a working Redis Sentinel deployment. Setting up Redis Sentinel is outside the scope of this guide, but detailed instructions are available on the official Redis website. Define Environment Variables The following environment variables are used to configure Sentinel support in Ubersmith. REDIS_SENTINEL_ENABLE Set to 1 to enable Redis Sentinel support. REDIS_SENTINEL_MASTER The name of the master group defined in your sentinel.conf file (e.g., mymaster). This is specified in the sentinel monitor directive. REDIS_USER The username for authenticating with Redis. If you are not using Redis ACLs, this can typically be default. REDIS_AUTH The password used to authenticate with the Redis master and its replicas. This password should be configured in your Redis instances (using the requirepass directive) and in your Sentinel configuration (using the sentinel auth-pass directive for the master group). REDIS_SENTINEL_HOSTS A comma-separated list of your Redis Sentinel hosts (e.g., 10.0.0.1,10.0.0.2,10.0.0.3). To avoid a "split-brain" condition, the official Redis documentation recommends deploying at least three Sentinel instances on separate machines. Update Docker Compose Configuration Navigate to your Ubersmith installation directory (default: /usr/local/ubersmith) and edit the docker-compose.override.yml file to add the environment variables. cd /usr/local/ubersmith Add the variables to the web service's environment section. The values below are examples; you must provide the master name, credentials, and host IPs specific to your setup. services: web: # ... other configuration ... environment: REDIS_SENTINEL_ENABLE: 1 REDIS_SENTINEL_MASTER: mymaster REDIS_USER: default REDIS_AUTH: your_redis_password REDIS_SENTINEL_HOSTS: 10.0.0.1, 10.0.0.2, 10.0.0.3 Apply Changes Recreate the web container to apply the new configuration. docker compose up -d web