Skip to content

boazjohn/redis-keepalived

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Simple setup using Keepalived for Redis HA

Uses redis-cli for failover.

In master, install redis, keepalived, clone and copy the files:

sudo cp ./config/redis.conf /etc/redis.conf
sudo cp /.config/keepalived.master /etc/keepalived/keepalived.conf

# Optional
sudo chown -R redis:redis /etc/redis.conf
sudo chmod -R 644 /etc/redis.conf
sudo chmod -R 644 /etc/keepalived/keepalived.conf

# Copy scripts
sudo mkdir -p /etc/keepalived/scripts
sudo cp ./scripts /etc/keepalived/scripts
sudo chmod -R +x /etc/keepalived/scripts

In slave, install redis and keepalive and copy configs:

sudo cp ./config/redis.conf /etc/redis.conf
sudo cp /.config/keepalived.slave /etc/keepalived/keepalived.conf

# Optional
sudo chown -R redis:redis /etc/redis.conf
sudo chmod -R 644 /etc/redis.conf
sudo chmod -R 644 /etc/keepalived/keepalived.conf

# Copy scripts
sudo mkdir -p /etc/keepalived/scripts
sudo cp ./scripts /etc/keepalived/scripts
sudo chmod -R +x /etc/keepalived/scripts

Start the server and check statuses.

About

Simple Redis HA with keepalived

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%