first, the Sentinel of RedisThe Redis Sentinel system is used to manage multiple Redis servers, which perform three main tasks1: Monitoring2: Reminders3: Automatic failover
Second, configure SentinelModify sentinel.conf File Sentinel Monitor MyMaster 192.168.1.170 6379 2 (2 means: 2 votes to judge the objective Downline) Start Sentinelredis-sentinel sentinel.conf Sentinel Log Detail Description http://redisdoc.com/topic/sentinel.html perform the following command to view the Redis master-slave information
[[Email protected] vagrant]#Redis-Cli-H192.168.9.17 -P26379InfoSentinel# SentinelSentinel_masters:1sentinel_tilt:0sentinel_running_ Scripts:0sentinel_scripts_queue_length : 0master0:name=master1,status=ok ,address=192.168.< Span class= "lit" >9.18:6379,slaves=1,sentinels= 1
Three, the principleSubjective downline and objective downline
Iv. Some of Sentinel's commands
INFO
Sentinel's basic status information
SENTINEL Masters
Lists all monitored primary servers, and the current status of these primary servers
SENTINEL Slaves <master name>
Lists all slave servers for a given primary server, and the current state of those from the server
SENTINEL get-master-addr-by-name <master name>
Returns the IP address and port number of the primary server for the given name
SENTINEL Reset <pattern>
Resets all names to the primary server that match the given pattern pattern. The reset operation clears all current state of the primary server, including the failover in progress, and removes all the slave servers and Sentinel from the primary server that are currently discovered and associated.
SENTINEL Failover <master name>
When the primary server fails, forces an automatic failover to start without asking other Sentinel comments, but it sends an up-to-date configuration to other Sentinel, and other Sentinel updates are based on this configuration
V. Java Operations Sentinel Reference: http://blog.csdn.net/pi9nc/article/details/17735653
The Sentinel of Redis