After you enable automatic shard addition for a Tair (Redis OSS-compatible) instance, Database Autonomy Service (DAS) automatically adds shards to the instance if sudden spikes in database traffic occur in the instance. This helps keep the memory utilization of the instance at a safe level, prevent out-of-memory issues, and ensure the stability of your online business. This topic describes how to enable automatic shard addition for a Tair (Redis OSS-compatible) instance.
Prerequisites
The database instance that you want to manage is an Tair (Redis OSS-compatible) Community Edition cloud-native cluster instance.
Scenario
If you enable automatic shard addition for a Tair (Redis OSS-compatible) instance in DAS, DAS automatically adds one shard to the instance when the available memory of the instance is insufficient.
Procedure
Log on to the DAS console.
In the left-side navigation pane, click Instance Monitoring. On the Instance Monitoring page, click the Redis tab.
On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.
In the left-side navigation pane of the instance details page, click Autonomy Center. In the upper-right corner of the page that appears, click Autonomy Service Settings.
On the Autonomous Function Settings tab of the Autonomous Function Management panel, enable the autonomy service. On the Optimization and Throttling tab, select Automatically Add Shards and configure the parameters that are described in the following table.
Parameter
Description
Average Memory Usage ≥
The threshold for triggering automatic shard addition.
Maximum Number of Shards
The maximum number of shards in the instance. The value must be a positive integer. Valid values: 4 to 32.
NoteWhen the total number of shards in the instance reaches the specified limit, shards are no longer automatically added to the instance.
Observation Window
The time range during which the performance of the database instance is observed.
NoteDAS periodically checks the instance. During the observation window, when the average memory utilization of the instance reaches the specified threshold, DAS automatically adds a shard to the instance.
NoteThe billing rules and configuration change process are the same as those for manually adjusting the number of shards for a Tair (Redis OSS-compatible) cloud disk-based instance. For more information, see Change the configurations of an instance.
Click OK.
Optional. On the Event Subscription Settings tab, complete the event subscription settings to send notifications when a shard is automatically added to the instance.
If a shard is automatically added, DAS generates an event at the Notice level. To use this feature, you must turn on the switch to enable event subscription and configure event notification parameters. For more information, see Event subscription.
In the Alert Configuration section, configure an alert template and subscribe to alert notifications. This helps you understand the status of an automatic shard addition task at the earliest opportunity.
The system recommends an alert template and adds alert rules for the required autonomy events in the alert template. You can configure the alert template as prompted.
NoteIf you have configured an alert template for your database instance, you must add alert rules for the required autonomy event to the alert template as prompted.
For more information about how to configure an alert template and alert rules for your database instance, see Configure alert templates and Configure alert rules.
In the Select Contact Group section, select an alert contact group.
Click Add Contact to add an alert contact.
Click Create Contact Group to create an alert contact group.
Find the alert contact that you want to manage and click Edit or Remove in the Actions column to modify or delete information about the alert contact.
For more information, see Manage alert contacts.
Click Submit Configuration. In the dialog box that appears, confirm the configuration.
References
If you want to reduce the number of shards in a Tair (Redis OSS-compatible) instance, you must manually adjust the number of shards. For more information, see Adjust the number of shards for an instance.