Split a shard
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.
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.
| 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 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=0Response 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"
}
]