Sentinel mode is a special mode. First, 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.
Sentinel is a high-availability solution for Redis: a Sentinel system consisting of one or more Sentinel instances can monitor any number of master servers, as well as these master servers All slave servers under it, and when the monitored master server goes offline, a slave server under the offline master server will be automatically upgraded to the new master server. (Recommended learning: Redis video tutorial)
Main functions
1. Monitor whether redis is running well as expected from time to time;
2. If a redis node is found to be running in trouble, it can notify another process (such as its client);
3. Automatic switching can be performed. When a master node is unavailable, one of the master's multiple slaves (if there is more than one slave) can be elected as the new master. The other slave nodes will change the address of the master they follow to be promoted to The new address of the master's slave.
4. Sentinel provides service discovery for the client. The client connects to Sentinel. Sentinel provides the address of the current master and then provides services. If a switch occurs, that is, the master hangs up, Sentinel will provide the client with a new address.
For more redis related technical knowledge, please visit the Redis usage tutorial column to learn!
The above is the detailed content of What is redis sentry mode. For more information, please follow other related articles on the PHP Chinese website!