Under the trend of Internet, the usability of user experience and service is becoming more and more important. The unavailability of any one of these services can lead to cascading functional failures.
Objective
The highly available model has gradually formed a routine:
- Master/Slave mode
- Cluster mode
Master/Slave mode
There are at least two service node master and Backup/slave. At the same time, only one service node serves as a standby/slave for one service--master,backup/slave. When Master goes down, it immediately switches to one of the backup/slave, and one of the backup/slave becomes master, providing services to the outside world.
It can be divided from the angle of the master/slave or no interaction:
- Master-Slave Interaction: such as MySQL master and slave to maintain heartbeat, synchronization data
- Master never interactive mode: Nginx Master and Standby do not interact, keepalive guarantee VIP Binding
From a failover mode perspective:
- Automatic failover/master-slave switching with third-party components: for master-slave switching using keepalive
- Self-failure automatic transfer of master-slave Server Software: Redis Sentinel Master-slave mode is self-implemented by Redis
- Manual switchover, transfer failure: Operations personnel involved, through the operation to achieve the switch
Cluster mode
There are at least two service nodes that comprise the group of Service nodes, and the client often uses various routing algorithms:
- Round robin
- Weight
- Random
- Consistent Hash
So that each service node in the group provides consistent and coordinated service to the outside. That is, a cluster of one or some of the service node down, the normal node can still provide external availability services, to ensure high availability of services. Cluster mode is naturally characterized by high availability.
High Availability in Redis
The good news for Redis users is that both of these high-availability modes are implemented in Redis.
Redis provides Sentinel Sentinel mode, which is the standard implementation of master-slave mode. Sentinel Sentinel mode, divided into Sentinel and storage two types of nodes. Sentinel node is responsible for maintaining, monitoring, switching storage nodes, storage node is mainly responsible for providing data management capabilities-the single-machine Redis capability.
Redis also provides cluster mode, the Redis cluster mode is a new feature introduced by Redis 3.0. Each node in the whole cluster serves as a storage node and is externally coordinated.
Users can also simply use the shell and keepalive to achieve Redis master-slave mode, but in the Redis Perfect Sentinel mode, this way is dwarfed.
Redis (ix) High-Availability column "Introduction"