|
53 | 53 | | `REDIS_TLS_CA_PATH` | | Path to the CA certificate for the Redis connection. | |
54 | 54 | | `REDIS_TLS_CERT_PATH` | | Path to the certificate for the Redis connection. | |
55 | 55 | | `REDIS_TLS_KEY_PATH` | | Path to the private key for the Redis connection. | |
56 | | -| `REDIS_KEY_PREFIX` | `` | Optional prefix for all Redis keys to avoid key collisions with other applications. Should end with `:`. | |
57 | | -| `REDIS_CLUSTER_ENABLED` | `false` | Set to `true` to enable Redis cluster mode. When enabled, you must also provide `REDIS_CLUSTER_NODES`. | |
58 | | -| `REDIS_CLUSTER_NODES` | | Comma-separated list of Redis cluster nodes in the format `host:port`. Required when `REDIS_CLUSTER_ENABLED` is `true`. | |
| 56 | +| `REDIS_KEY_PREFIX` | `` | Optional prefix for all Redis keys to avoid key collisions with other applications. Should end with `:`. | |
| 57 | +| `REDIS_CLUSTER_ENABLED` | `false` | Set to `true` to enable Redis cluster mode. When enabled, you must also provide `REDIS_CLUSTER_NODES`. | |
| 58 | +| `REDIS_CLUSTER_NODES` | | Comma-separated list of Redis cluster nodes in the format `host:port`. Required when `REDIS_CLUSTER_ENABLED` is `true`. | |
| 59 | +| `REDIS_SENTINEL_ENABLED` | `false` | Set to `true` to enable Redis Sentinel mode. Cannot be enabled simultaneously with cluster mode. | |
| 60 | +| `REDIS_SENTINEL_NODES` | | Comma-separated list of Redis Sentinel nodes in the format `host:port`. Required when `REDIS_SENTINEL_ENABLED` is `true`. | |
| 61 | +| `REDIS_SENTINEL_MASTER_NAME` | | Name of the Redis Sentinel master. Required when `REDIS_SENTINEL_ENABLED` is `true`. | |
| 62 | +| `REDIS_SENTINEL_USERNAME` | | Username for Redis Sentinel authentication (optional). | |
| 63 | +| `REDIS_SENTINEL_PASSWORD` | | Password for Redis Sentinel authentication (optional). | |
59 | 64 |
|
60 | 65 | ## Deployment Options |
61 | 66 |
|
@@ -191,6 +196,46 @@ When using Redis cluster mode: |
191 | 196 |
|
192 | 197 | </Callout> |
193 | 198 |
|
| 199 | +## Redis Sentinel Mode |
| 200 | + |
| 201 | +Redis Sentinel provides high availability for Redis deployments without the complexity of full cluster mode. |
| 202 | +It automatically monitors Redis master and replica instances, handles failover, and provides service discovery. |
| 203 | +This makes it ideal for deployments that need automatic failover but don't require horizontal scaling across multiple shards. |
| 204 | + |
| 205 | +### Configuration |
| 206 | + |
| 207 | +To enable Redis Sentinel mode, set the following environment variables: |
| 208 | + |
| 209 | +```bash |
| 210 | +REDIS_SENTINEL_ENABLED=true |
| 211 | +REDIS_SENTINEL_NODES=sentinel1:26379,sentinel2:26379,sentinel3:26379 |
| 212 | +REDIS_SENTINEL_MASTER_NAME=mymaster |
| 213 | +REDIS_AUTH=your-redis-password # if authentication is enabled on Redis |
| 214 | +REDIS_SENTINEL_PASSWORD=your-sentinel-password # if authentication is enabled on Sentinels (optional) |
| 215 | +``` |
| 216 | + |
| 217 | +### Example Configurations |
| 218 | + |
| 219 | +#### Self-hosted Redis with Sentinel |
| 220 | + |
| 221 | +```bash |
| 222 | +REDIS_SENTINEL_ENABLED=true |
| 223 | +REDIS_SENTINEL_NODES=10.0.1.10:26379,10.0.1.11:26379,10.0.1.12:26379 |
| 224 | +REDIS_SENTINEL_MASTER_NAME=langfuse-master |
| 225 | +REDIS_AUTH=your-redis-password |
| 226 | +``` |
| 227 | + |
| 228 | +<Callout type="warning"> |
| 229 | + |
| 230 | +When using Redis Sentinel mode: |
| 231 | + |
| 232 | +- Ensure all Sentinel nodes are accessible from your Langfuse containers |
| 233 | +- The `REDIS_SENTINEL_MASTER_NAME` must match the master name configured in your Sentinel setup |
| 234 | +- Set `maxmemory-policy=noeviction` on the Redis master and replicas to prevent queue job eviction |
| 235 | +- TLS configuration (if enabled) applies to connections to both Sentinels and Redis instances |
| 236 | + |
| 237 | +</Callout> |
| 238 | + |
194 | 239 | ## Sizing Recommendations |
195 | 240 |
|
196 | 241 | Langfuse uses Redis mainly for queuing event metadata that should be processed by the worker. |
|
0 commit comments