Redis Sentinel provides high availability for Redis. Tair (Redis OSS-compatible) provides the Sentinel-compatible mode to support services that run Sentinel. This topic describes how to enable the Sentinel-compatible mode in the console.
Prerequisites
The engine version of the instance is Redis 4.0 or later.
The instance is deployed in a virtual private cloud (VPC).
NoteIf the instance runs in the classic network, switch the network type of the instance to VPC. For more information, see Switch the network type from classic network to VPC.
Overview of Redis Sentinel
Redis Sentinel provides Redis with features such as master and replica monitoring, fault alerting, and automatic failover. Redis Sentinel is suitable for many business scenarios that use self-managed Redis databases and require high reliability. To facilitate the migration of these self-managed Redis databases to the cloud, Alibaba Cloud provides the Sentinel-compatible mode.
Tair (Redis OSS-compatible) uses the high-availability (HA) component developed by Alibaba Cloud instead of Redis Sentinel. For more information, see Functions and features.
After you enable the Sentinel-compatible mode, you can run the Sentinel commands described in the following table.
Command | Description |
SENTINEL sentinels | Queries Sentinel instances of a specified master and the status of these Sentinel instances. The following syntax is used:
|
SENTINEL get-master-addr-by-name | Queries the IP address and port number of a specified master. The following syntax is used:
|
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
In the left-side navigation pane of the Instance Information page, click Parameter Settings.
Enable the Sentinel-compatible mode for the instance by modifying the corresponding parameter based on the instance architecture. For more information, see Configure instance parameters.
If the instance is a read/write splitting instance or a cluster instance in proxy mode, set the sentinel_compat_enable parameter to 1.
If the instance is a standard instance, set the #no_loose_sentinel-enabled parameter to yes.
NoteYou can view the instance architecture on the instance details page.
Cluster instances in direct connection mode use open source Redis Cluster for load balancing, eliminating the need for the Sentinel component. Additionally, Sentinel parameters cannot be configured in this mode.
(Optional) After you enable the Sentinel-compatible mode for the instance, connect to the instance and run the
SENTINEL sentinels test
command. If the command execution is successful, the Redis Sentinel-compatible mode is enabled for the instance.The Sentinel-compatible mode does not provide additional endpoints. You can use the original endpoint, such as
r-********.redis.rds.aliyuncs.com:6379
to connect to the instance.NoteTo enable password-free access for the SENTINEL command, you can set the #no_loose_sentinel-password-free-access parameter to yes. This allows the use of the SUBSCRIBE and SENTINEL commands to subscribe to and listen for the
+switch-master
channel without requiring a password.If you want to allow additional commands to be accessed without using a password, you can use the #no_loose_sentinel-password-free-commands parameter to specify the commands after you set the #no_loose_sentinel-password-free-access parameter to yes.
Related API operations
API operation | Description |
Queries the configuration and operational parameters of an instance. | |
Modifies the parameter settings of an instance. |