Friday, February 18, 2022

How To Setup Redis Replication ( General Primary-Replica settings )

 in This Tutorial you will Learn "How To Setup Redis Replication ( General Primary-Replica settings )"

Redis (Remote Directory Server) is a popular in-memory data structure store used as a database, cache and message broker.
what is redis replication -
Redis replication is a very simple to use and configure master-slave replication that allows slave Redis servers to be exact copies of master servers.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      | IP -192.168.1.60        |Hostname - server.yourdomain.com
_________________________________________________________________________________________
cat /etc/system-release ; dnf groupinstall "Development Tools" -y
dnf module -y install redis:6
gedit  /etc/redis.conf   &>/dev/null  ||  nano /etc/redis.conf
bind 0.0.0.0 | daemonize yes |
min-replicas-to-write 1
min-replicas-max-lag 10
# requirepass password
systemctl enable --now redis ; systemctl restart redis ; systemctl status redis
firewall-cmd --add-service=redis --permanent ; firewall-cmd --reload
_________________________________________________________________________________________
Replica Host-
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf module -y install redis:6

gedit  /etc/redis.conf &>/dev/null   Or nano /etc/redis.conf
bind 0.0.0.0  | daemonize yes  || replicaof 192.168.1.60 6379 || masterauth password || replica-read-only yes
# requirepass password

firewall-cmd --add-service=redis --permanent ; firewall-cmd --reload
systemctl restart redis
redis-cli
auth password
info Replication
_________________________________________________________________________________________


No comments:

Post a Comment