{"id":27243432,"url":"https://github.com/dalee/redis-ha-playground","last_synced_at":"2026-05-15T13:05:44.336Z","repository":{"id":67450059,"uuid":"102615302","full_name":"Dalee/redis-ha-playground","owner":"Dalee","description":"Minimal Redis 3.x High Availability setup with failover and correct load balancing.","archived":false,"fork":false,"pushed_at":"2017-09-06T19:06:04.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-07T12:47:34.167Z","etag":null,"topics":["example","high-availability","redis","setup"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Dalee.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":"2017-09-06T13:58:11.000Z","updated_at":"2017-09-06T19:51:20.000Z","dependencies_parsed_at":"2023-06-11T02:50:23.472Z","dependency_job_id":null,"html_url":"https://github.com/Dalee/redis-ha-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dalee/redis-ha-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dalee%2Fredis-ha-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dalee%2Fredis-ha-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dalee%2Fredis-ha-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dalee%2Fredis-ha-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dalee","download_url":"https://codeload.github.com/Dalee/redis-ha-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dalee%2Fredis-ha-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":["example","high-availability","redis","setup"],"created_at":"2025-04-10T20:36:54.654Z","updated_at":"2026-05-15T13:05:44.319Z","avatar_url":"https://github.com/Dalee.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimal Redis 3.x High Availability setup\n\nVagrant based playground for setting up two Redis instances with \nreplication, failover and correct load balancing.\n\n## setting up\n\n```\n$ vagrant up\n$ vagrant ssh\n$ /vagrant/setup.sh\n```\n\nInitial configuration:\n* redis on port `6379` is `master`\n* redis on port `6380` is `slave`\n* redis-sentinel on port `26379` is failover arbiter\n* haproxy on port `6378` is redis balancer\n\n\u003e Each run of `setup.sh` script, reverts state to initial configuration.\n\n## checking setup\n\nensure redis on port 6379 is `master`:\n```bash\n$ redis-cli -p 6379 info replication | grep role\nrole:master\n```\n\nensure redis on port 6380 is `slave`:\n```bash\n$ redis-cli -p 6380 info replication | grep role\nrole:slave\n```\n\nensure `master` is accessible via haproxy:\n```bash\n$ redis-cli -p 6378 info | grep -E \"role|connected_slaves|config_file\"\nconfig_file:/data/redis-farm/redis-6379.conf\nrole:master\nconnected_slaves:1\n```\n\n## testing failover\n\nset our sample key:\n```bash\n$ redis-cli -p 6378 set hello world\nOK\n```\n\nkill `master` node\n```bash\nredis-cli -p 6379 debug segfault\nError: Server closed the connection\n```\n\nwait for few seconds to allow sentinel perform failover.\n\nensure key is still accessible via haproxy:\n```bash\nredis-cli -p 6378 get hello\n\"world\"\n```\n\nchecking haproxy is poining to `master` node:\n```bash\n$ redis-cli -p 6378 set hello \"cruel world\"\nOK\n```\n\nchecking redis role on port 6380:\n```bash\n$ redis-cli -p 6380 info replication | grep role\nrole:master\n```\n\n## return failed redis node back\n\nstart failed redis node:\n```bash\n$ sudo systemctl start redis-6379\n```\n\ncheck redis role on port 6379:\n```bash\n$ redis-cli -p 6379 info replication | grep role\nrole:slave\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalee%2Fredis-ha-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalee%2Fredis-ha-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalee%2Fredis-ha-playground/lists"}