cubefs/docs/source/dev-guide/admin-api/master/data-partition.md
zhumingze 4f0935dccb docs(docs): Modify the docs according to v3.5.2
Signed-off-by: zhumingze <zhumingze@oppo.com>
2025-08-11 17:21:20 +08:00

2.0 KiB
Executable File

Data Shard Management

Create

curl -v "http://10.196.59.198:17010/dataPartition/create?count=400&name=test"

Creates a specified number of data shards.

Parameter List

Parameter Type Description
count int Number of data shards to create
name string Volume name

Query

curl -v "http://10.196.59.198:17010/dataPartition/get?id=100"  | python -m json.tool

Displays detailed information about the data shard, including the number of replicas, volume information, etc.

Parameter List

Parameter Type Description
id uint64 Data shard ID

Response Example

{
    "PartitionID": 100,
    "LastLoadedTime": 1544082851,
    "ReplicaNum": 3,
    "Status": 2,
    "Replicas": {},
    "Hosts": {},
    "Peers": {},
    "Zones": {},
    "MissingNodes": {},
    "VolName": "test",
    "VolID": 2,
    "FileInCoreMap": {},
    "FilesWithMissingReplica": {}
}

Decommission Replica

curl -v "http://10.196.59.198:17010/dataPartition/decommission?id=13&addr=10.196.59.201:17310&weight=2"

Removes a replica of the data shard and creates a new replica.

Parameter List

Parameter Type Description
id uint64 Data shard ID
addr string Address of the replica to be removed
weight int Decommission weight, default is 2

Compare Replica Files

curl -v "http://10.196.59.198:17010/dataPartition/load?id=1"

Sends a task to compare the replica files for each replica of the data shard, and then asynchronously checks whether the file CRC on each replica is consistent.

Parameter List

Parameter Type Description
id uint64 Data shard ID