Tair (Redis OSS-compatible) provides the Sentinel-compatible mode to support services that run Sentinel. This topic describes how to enable the mode from the console.
Prerequisites
Before you begin, make sure that:
The instance runs Redis 4.0 or later
The instance uses a virtual private cloud (VPC) as the network type
If the instance uses the classic network, switch to a VPC first. See Switch to a VPC for the switching method.
How it works
Redis Sentinel provides high availability for Redis through master and replica monitoring, fault alerting, and automatic failover. Many self-managed Redis deployments rely on Sentinel for reliability.
Tair (Redis OSS-compatible) uses Alibaba Cloud's own high availability component internally — not Redis Sentinel. The Sentinel-compatible mode exposes a Sentinel-compatible API layer, so existing Sentinel-aware clients can connect to your Tair instance using the same commands and connection logic they already use.
After you enable the mode, use redis_master as the master name in all Sentinel commands.
Supported Sentinel commands
SENTINEL sentinels
Returns information about the Sentinel instances monitoring a specified master.
SENTINEL sentinels redis_masterSENTINEL get-master-addr-by-name
Returns the IP address and port of a specified master.
SENTINEL get-master-addr-by-name redis_masterEnable the Sentinel-compatible mode
Log on to the console and go to the Instances page. In the top navigation bar, select the region where the instance resides, find the instance, and click the instance ID.
In the navigation pane on the left of the Instance Information page, click Parameter Settings.
Based on the instance architecture, set the corresponding parameter to enable the mode. For more information, see Set parameters.
NoteCheck the architecture on the instance details page.
The cluster architecture in direct connection mode uses open source Redis Cluster for load balancing. It does not require the Sentinel component and does not support setting Sentinel parameters.
Architecture Parameter Value Cluster architecture (proxy mode) or read/write splitting sentinel_compat_enable1Standard architecture #no_loose_sentinel-enabledyes(Optional) Verify that the mode is enabled. Connect to the instance and run the following command:
SENTINEL sentinels redis_masterIf the command executes successfully, the Redis Sentinel-compatible mode is enabled for the instance.
After enabling the mode, connect using the original connection address (for example, r-********.redis.rds.aliyuncs.com:6379). The Sentinel-compatible mode does not provide a separate connection address.
Password-free access for Sentinel commands
To set password-free access for the SENTINEL command, set the #no_loose_sentinel-password-free-access parameter to yes. This lets you use the SUBSCRIBE and SENTINEL commands to subscribe to and monitor the +switch-master channel without a password.
To allow additional commands without a password, add them through the #no_loose_sentinel-password-free-commands parameter.
What's next
Connect your application to the instance using the Sentinel-compatible mode. See Connect to an instance in Sentinel-compatible mode.
API reference
| Operation | Description |
|---|---|
| DescribeParameters | Queries the configuration and operational parameters of an instance. |
| ModifyInstanceConfig | Modifies the parameter settings of an instance. |