Sentinel mode is a special mode. First of all, Redis provides sentinel commands. Sentinel is an independent process. As a process, it will run independently. The principle is that the sentinel monitors multiple running Redis instances by sending commands and waiting for the Redis server to respond. (Recommended learning: redis video tutorial )
#qi to send the Redis server to monitor its running status, including the main server and the server.
When Sentinel detects that the master is down, it will automatically switch the slave to the master, and then notify other slave servers through the publish and subscribe mode, modify the configuration file, and let them switch hosts.
# 启动Redis服务器进程 ./redis-server ../redis.conf # 启动哨兵进程 ./redis-sentinel ../sentinel.conf
windows Start redis-server.exe sentinel.conf --sentinel
First the Redis service process of the host (192.168.11.128), and then start the slave Service process, and finally start three sentinel service processes.
Enter with the client, check the status with info
192.168.65.1 192.168.65.1
For more Redis related technical articles, please visit Getting Started Tutorial on Using Redis Database Column for learning!
The above is the detailed content of How to restart the sentinel service in redis. For more information, please follow other related articles on the PHP Chinese website!