Redis Sentinel provides high availability (HA) services for Redis. ApsaraDB for Redis is compatible with Sentinel and can be used for services that run Sentinel. This topic describes how to enable the Redis Sentinel-compatible mode in the ApsaraDB for Redis console.

Prerequisites

To use the Redis Sentinel-compatible mode, ApsaraDB for Redis instances must meet the following requirements:

Table 1. Requirements of the Redis Sentinel-compatible mode
Item Description
Engine version Redis 4.0 or 5.0
Network type VPC
Prerequisite Password-free access is enabled.

Introduction to Redis Sentinel

Redis Sentinel provides Redis with services such as master and replica monitoring, fault alerting, and automatic failover. Redis Sentinel is used in many business scenarios that use local on-premises Redis databases and require high reliability. To facilitate the migration of Redis databases to the cloud in such scenarios, Alibaba Cloud provides the Redis Sentinel-compatible mode.

Note ApsaraDB for Redis uses the HA component developed by Alibaba Cloud, without the need to use Redis Sentinel.

After you enable the Sentinel-compatible mode, you can use the following commands:

Command Description
SENTINEL sentinels Queries Sentinel instances for a specified master and the status of these Sentinel instances. Follow this syntax:
SENTINEL sentinels <the name of a master>
SENTINEL get-master-addr-by-name Queries the IP address and port number of a specified master. Follow this syntax:
SENTINEL get-master-addr-by-name <the name of a master>
Note Instances of ApsaraDB for Redis 2.8 do not support the preceding commands.

Specify the parameter in the ApsaraDB for Redis console

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the target instance ID or click Manage in the Actions column.
  4. By default, the Instance Information page is displayed. In the left-side navigation pane, click System Parameters.
  5. On the System Parameters page, find the #no_loose_sentinel-enabled parameter and click Modify in the Actions column.
    Note If an instance of Redis 4.0 does not support this parameter, upgrade the minor version.
  6. In the dialog box that appears, set the parameter to yes, and click OK.

    For more information about the parameters, see Parameter overview and configuration guide.

Call API operations to set parameters

You can also call the ModifyInstanceConfig operation to set parameters.