{"id":31563388,"url":"https://github.com/fosterg4/redis-cluster-sentinel","last_synced_at":"2026-02-20T18:31:10.793Z","repository":{"id":304741994,"uuid":"1019797625","full_name":"FosterG4/Redis-Cluster-Sentinel","owner":"FosterG4","description":"Redis Cluster Sentinel","archived":false,"fork":false,"pushed_at":"2025-07-14T22:44:47.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T04:59:02.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FosterG4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T22:25:01.000Z","updated_at":"2025-07-14T22:44:50.000Z","dependencies_parsed_at":"2025-07-15T03:15:33.556Z","dependency_job_id":null,"html_url":"https://github.com/FosterG4/Redis-Cluster-Sentinel","commit_stats":null,"previous_names":["fosterg4/redis-cluster-sentinel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FosterG4/Redis-Cluster-Sentinel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FosterG4%2FRedis-Cluster-Sentinel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FosterG4%2FRedis-Cluster-Sentinel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FosterG4%2FRedis-Cluster-Sentinel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FosterG4%2FRedis-Cluster-Sentinel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FosterG4","download_url":"https://codeload.github.com/FosterG4/Redis-Cluster-Sentinel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FosterG4%2FRedis-Cluster-Sentinel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29660019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-05T04:58:54.557Z","updated_at":"2026-02-20T18:31:10.774Z","avatar_url":"https://github.com/FosterG4.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis High-Availability Cluster with Sentinel\n\nA production-ready Redis cluster setup using Docker Compose with a master-slave replication configuration and Sentinel for automatic failover.\n\n## Architecture\n\n- **Redis Master**: Primary write node with persistence\n- **Redis Slaves (2)**: Read replicas that sync with master\n- **Redis Sentinel**: Monitors master/slave health and manages failover\n\n## System Requirements\n\n- Docker and Docker Compose\n- Recommended: 4 CPU cores and 8GB RAM minimum\n\n## Quick Start\n\n1. Clone this repository\n2. Edit `.env` file to set strong passwords and tune memory settings\n3. Start the cluster:\n\n```bash\ndocker-compose up -d\n```\n\n## Configuration\n\n### Environment Variables\n\nEdit the `.env` file to configure:\n\n- `REDIS_PASSWORD`: Authentication password (use a strong one!)\n- `SENTINEL_QUORUM`: Number of sentinels required to agree for failover (default: 2)\n- `SENTINEL_DOWN_AFTER`: Time in ms to wait before considering master down (default: 5000)\n- `SENTINEL_FAILOVER_TIMEOUT`: Time in ms allowed for failover (default: 10000)\n- `REDIS_MAX_MEMORY_MASTER`: Memory limit for master node (default: 2gb)\n- `REDIS_MAX_MEMORY_SLAVE`: Memory limit for slave nodes (default: 1gb)\n\n### Advanced Configuration\n\nFor more advanced tuning, modify:\n\n- `redis-master.conf` - Master node configuration\n- `redis-slave.conf` - Slave node configuration\n- `sentinel.conf` - Sentinel configuration\n\n## Connecting to Redis\n\n### Master (Write operations)\n\n```bash\ndocker exec -it redis-master redis-cli -a $REDIS_PASSWORD\n# OR\nredis-cli -h localhost -p 6379 -a your_redis_password\n```\n\n### Slaves (Read operations)\n\n```bash\ndocker exec -it redis-slave-1 redis-cli -a $REDIS_PASSWORD\n# OR\nredis-cli -h localhost -p 6380 -a your_redis_password\nredis-cli -h localhost -p 6381 -a your_redis_password\n```\n\n### Sentinel (Monitoring and querying cluster state)\n\n```bash\ndocker exec -it redis-sentinel redis-cli -p 26379\n# OR\nredis-cli -h localhost -p 26379\n```\n\nTo find the current master:\n\n```\nsentinel get-master-addr-by-name mymaster\n```\n\n## Production Considerations\n\n1. **Security**: \n   - Use a strong Redis password in `.env`\n   - Consider adding SSL/TLS termination in front of Redis\n   - Restrict access to Redis ports at the network level\n   - Disable dangerous commands with `rename-command` in config files\n\n2. **Performance**:\n   - Tune `maxmemory` and `maxmemory-policy` based on your workload\n   - Adjust `tcp-backlog` for high-concurrency workloads\n   - Set `io-threads` for CPU-intensive operations\n   - Enable `activedefrag` for better memory utilization\n\n3. **Monitoring**:\n   - Set up monitoring for Redis metrics (memory, connections, etc.)\n   - Monitor Sentinel logs for failover events\n   - Check replication status with `info replication` command\n\n## Troubleshooting\n\nCheck container logs:\n\n```bash\ndocker logs redis-master\ndocker logs redis-slave-1\ndocker logs redis-slave-2\ndocker logs redis-sentinel\n```\n\nCheck replication status:\n\n```bash\ndocker exec -it redis-master redis-cli -a $REDIS_PASSWORD info replication\n```\n\nVerify Sentinel configuration:\n\n```bash\ndocker exec -it redis-sentinel redis-cli -p 26379 sentinel master mymaster\n```\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosterg4%2Fredis-cluster-sentinel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffosterg4%2Fredis-cluster-sentinel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosterg4%2Fredis-cluster-sentinel/lists"}