You can call the `merge_shard` command to merge two contiguous shards that are in the `readwrite` state.
Request syntax
aliyunlog log merge_shard --project_name=<value> --logstore_name=<value> --shardId=<value> [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]Request parameters
The following table describes the required and unique parameters for this command.
Parameter name | Numeric types | Required | Example | Description |
--project_name | String | Yes | aliyun-test-project | The name of the project. |
--logstore_name | String | Yes | logstore-a | The name of the Logstore. |
--shardId | Integer | Yes | 2 | The ID of the shard. |
For more information about the global parameters for this command, see Global parameters.
Examples
Request example
Merge the shards of logstore-a using the default account.
aliyunlog log merge_shard --project_name="aliyun-test-project" --logstore_name="logstore-a" --shardId=2Response example
[{ "createTime": 1622095017, "exclusiveEndKey": "80000000000000000000000000000000", "inclusiveBeginKey": "00000000000000000000000000000000", "shardID": 4, "status": "readwrite" }, { "createTime": 1622087815, "exclusiveEndKey": "40000000000000000000000000000000", "inclusiveBeginKey": "00000000000000000000000000000000", "shardID": 2, "status": "readonly" }, { "createTime": 1622087815, "exclusiveEndKey": "80000000000000000000000000000000", "inclusiveBeginKey": "40000000000000000000000000000000", "shardID": 3, "status": "readonly" }]
Error codes
An error message is returned if a request fails. For a list of possible error codes, see Error codes.
API reference
该文章对您有帮助吗?