we can use redis sentinel to monitor redis in case of master shutdown, it can select new master
step 1: vi sentinel.conf in the redis dir, added the ip and port and quorum to it
sentinel monitor <master-name> <ip> <redis-port> <quorum>, like:
sentinel monitor redis6379 127.0.0.1 6379 1
step 2 :start the sentinel,using
redis-sentinel sentinel.conf
this way, it will monitor machine 127.0.0.1 on port 6379 and its slaves, if it shutdown, the sentinel will select one
whose quorum not less than 1 to to be the new mater, and then ,if the older mater-in the case, the 6379
of 127.0.0.1-to be recover, it will be slave, no master