Split a shard

Updated at:

Run CLI commands to split a specified 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

Each Logstore supports a maximum of 10 shards. Before you split a shard, make sure that the number of shards has not reached the upper limit.

Command syntax

aliyun sls split-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 split.

For information about global parameters, see Global parameters.

Command examples

  • Command example

Split the shard whose ID is 0 in the aliyun-test-logstore LogStore.

aliyun sls split-shard --project="aliyun-test-project" --logstore="aliyun-test-logstore" --shard=0
  • Response example

[
  {
    "shardID": 0,
    "status": "readonly",
    "inclusiveBeginKey": "00000000000000000000000000000000",
    "exclusiveEndKey": "7fffffffffffffffffffffffffffffff"
  },
  {
    "shardID": 2,
    "status": "readwrite",
    "inclusiveBeginKey": "00000000000000000000000000000000",
    "exclusiveEndKey": "3fffffffffffffffffffffffffffffff"
  },
  {
    "shardID": 3,
    "status": "readwrite",
    "inclusiveBeginKey": "3fffffffffffffffffffffffffffffff",
    "exclusiveEndKey": "7fffffffffffffffffffffffffffffff"
  }
]