Resharding bucket index dynamically
You can reshard the bucket index dynamically by adding the bucket to the resharding queue. It gets scheduled to be resharded. The reshard threads run in the background and runs the scheduled resharding, one at a time.
Prerequisites
-
A running IBM Storage Ceph cluster.
-
A Ceph Object Gateway installed.
Procedure
-
Set the
rgw_dynamic_resharding
parameter is set totrue
.Example
[ceph: root@host01 /]# radosgw-admin period get
-
Optional: Customize Ceph configuration using the following command:
Syntax
ceph config set client.rgw OPTION VALUE
Replace OPTION with the following options:
-
rgw_reshard_num_logs
: The number of shards for the resharding log. The default value is16
. -
rgw_reshard_bucket_lock_duration
: The duration of the lock on a bucket during resharding. The default value is360
seconds. -
rgw_dynamic_resharding
: Enables or disables dynamic resharding. The default value istrue
. -
rgw_max_objs_per_shard
: The maximum number of objects per shard. The default value is100000
objects per shard. -
rgw_reshard_thread_interval
: The maximum time between rounds of reshard thread processing. The default value is600
seconds.
Example
[ceph: root@host01 /]# ceph config set client.rgw rgw_reshard_num_logs 23
-
-
Add a bucket to the resharding queue:
Syntax
radosgw-admin reshard add --bucket BUCKET --num-shards NUMBER
Example
[ceph: root@host01 /]# radosgw-admin reshard add --bucket data --num-shards 10
-
List the resharding queue:
Example
[ceph: root@host01 /]# radosgw-admin reshard list
-
Check the bucket log generations and shards:
Example
[ceph: root@host01 /]# radosgw-admin bucket layout --bucket data { "layout": { "resharding": "None", "current_index": { "gen": 1, "layout": { "type": "Normal", "normal": { "num_shards": 23, "hash_type": "Mod" } } }, "logs": [ { "gen": 0, "layout": { "type": "InIndex", "in_index": { "gen": 0, "layout": { "num_shards": 11, "hash_type": "Mod" } } } }, { "gen": 1, "layout": { "type": "InIndex", "in_index": { "gen": 1, "layout": { "num_shards": 23, "hash_type": "Mod" } } } } ] } }
-
Check bucket resharding status:
Syntax
radosgw-admin reshard status --bucket BUCKET
Example
[ceph: root@host01 /]# radosgw-admin reshard status --bucket data
-
Process entries on the resharding queue immediately:
[ceph: root@host01 /]# radosgw-admin reshard process
-
Cancel pending bucket resharding:
Warning: You can only cancel pending resharding operations. Do not cancel ongoing resharding operations.Syntax
radosgw-admin reshard cancel --bucket BUCKET
Example
[ceph: root@host01 /]# radosgw-admin reshard cancel --bucket data
Verification
-
Check bucket resharding status:
Syntax
radosgw-admin reshard status --bucket BUCKET
Example
[ceph: root@host01 /]# radosgw-admin reshard status --bucket data
Reference
For more information, see the following: