CentOS 7 Redis 5.0.8 sentinel mode configuration

Prepare three virtual machines CentOS 7 environment, and then download the redis-5.0.8 installation package, I put it in the /opt directory

wget https://github.com/redis/redis/archive/5.0.8.tar.gz

Unzip

tar -xzvf redis-5.0.8.tar.gz

For the redis installation process of each virtual machine, please refer to my previous article

1. Three virtual machines

192.168.171.210( master) port 6379
192.168.171.211( slave) port 6379
192.168.171.212( slave) port 6379
192.168.171.210 ( sentinel) port 26379
192.168.171.211 ( sentinel) port 26379
192.168.171.212 ( sentinel) port 26379

2. Edit redis configuration file

# bind 127.0.0.1//Comment out this line protected-mode no     //Turn off protection mode
requirepass 10010//Set redis password,If you set a password,Three redis instances must set the same password

3. Edit sentinel.conf configuration file

daemonize yes    //Start the daemon
sentinel monitor mymaster 192.168.171.21263792
sentinel auth-pass mymaster 10010

4. Start in order

Start the master redis instance --> start the replicaof redis instance --> start three sentinel instances

systemctl start redisd
. /src/redis-sentinel sentinel.conf

5. Test failover

. /src/redis-cli -a 10010-p 6379 DEBUG sleep 40

Execute the above command on the master, and after 40 seconds, observe whether the master is changed to another instance

Recommended Posts

CentOS 7 Redis 5.0.8 sentinel mode configuration
Install Redis Sentinel on CentOS6 Single Node
CentOS7.0 network configuration
Installation and configuration of redis under centos7
CentOS7 basic configuration
Centos7 hive stand-alone mode installation and configuration
Centos MySQL8 configuration
Xfs configuration on centos7
Centos kernel compilation configuration
Mysql8.0.15 installation configuration (centos7)
Install redis5.0 in CentOS7
CentOS 7 install Redis 5.0.8 original
Centos mysql installation and configuration
Centos7.4 deployment configuration Elasticsearch5.6 cluster
Redis cluster installation under CentOS
CentOS 7 installation and configuration PPTP
CentOS installation and configuration cmake
CentOS 7 user account configuration original
Centos7.5 installation and configuration MongoDB4.0.4
Redis cluster installation under CentOS
CentOS 7 installation and configuration PPTP
CentOS mysql configuration master-slave replication
Implementation of CentOS8.0 Network Configuration
CentOS8 network card configuration file
CentOS 8 install Git and basic configuration
Centos7 hadoop cluster installation and configuration
CentOS configuration git server in VirtualBox
Install java in yum mode in Centos
CentOS7.2 and Nginx configuration virtual host
Detailed examples of Centos6 network configuration
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
Centos 7 RAID 5 detailed explanation and configuration
CentOS configuration swap exchange area method
CentOS NTP server installation and configuration
Centos7 mysql database installation and configuration
Tomcat configuration JMX in centos 6.5 environment