Master slave replication
1. Oneredis Service has multiple copies of the service, thisredis Service is calledmaster, Other copies are calledslaves
2. Master and slave will keep data synchronized
3. onlymaster Write command can be executed,slave Read command only( default)
4. Creation of master-slave replication
1) Create a slave node:redis-server --port 6379 --slaveof master-ip master-port
2) Start one firstredis service, In the client, change to from
>slaveof master-ip master-port
From slave to master in client
>slaveof no one
Client connection:redis-cli -h ip -p port -n dbnum
3) Profile mode: Read profile at startup.6380.conf
slaveof ip port
port 6380
redis-server 6380.conf
5. Master slave replication problem
master down, Need to manuallyslave Useslaveof no one Upgrade tomaster
To achieve automation, Needredis Sentry

redis High availability sentry
1. Start a run inSentine Moderedis Service instance
redis-server /path/to/sentinel.conf --sentinel
eachsentinel Can monitor any number ofmaster And themaster Lowerslaves
Monitoring the samemaster Ofsentinel Will automatically connect, Have a vote, Similarzk,3 Node

2.sentinel configuration file
Contains at least one monitoring configuration option, Used for monitoringmaster
sentinel monitor name ip port quorum( At least a few votes), for example:
sentinel monitor mymaster 6379 2
sentinel Default port26379
$redis-sentinel sentinel1.conf
port 26379
sentinel monitor s1 6379 2
One for each machinesentinel that will do.

3. Start firstredis Master-slave, Post startsentinel