Merge shards
Updated at:
Run CLI commands to merge a specified shard with its adjacent shard in a Logstore.
Prerequisites
Before you begin, make sure that:
Simple Log Service (SLS) is activated. For more information, see Get started with SLS.
The SLS CLI is installed and configured. For more information, see Install and configure the new SLS CLI.
An SLS project and Logstore are created. For more information, see Create a project and Create a Logstore.
Note
You can merge only adjacent shards, and both shards must be in the readwrite state.
Command syntax
aliyun sls merge-shard --project=<value> --logstore=<value> --shard=<value>Parameters
The following table describes the required and command-specific parameters.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| --project | String | Yes | aliyun-test-project | The name of the project. |
| --logstore | String | Yes | aliyun-test-logstore | The name of the Logstore. |
| --shard | Integer | Yes | 0 | The ID of the shard to merge. The system merges this shard with the adjacent shard that has the next highest ID. |
For information about global parameters, see Global parameters.
Is this page helpful?