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.

ParameterTypeRequiredExampleDescription
--projectStringYesaliyun-test-projectThe name of the project.
--logstoreStringYesaliyun-test-logstoreThe name of the Logstore.
--shardIntegerYes0The 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.