一 swift-ring-builder 命令
swift-ring-builder中包含多种命令:
add
create
list_parts
rebalance
remove
search
set_info
set_min_part_hours
set_weight
set_replicas
validate
write_ring
二 swift-ring-builder命令详细解释
swift-ring-builder <builder_file>
Shows information about the ring and the devices within.
显示ring以及ring中设备的信息,swift-1.8.0中对device新增了一个region属性
swift-ring-builder <builder_file> add
z<zone>-<ip>:<port>/<device_name>_<meta> <weight>
[z<zone>-<ip>:<port>/<device_name>_<meta> <weight>] ...
Adds devices to the ring with the given information. No partitions will be
assigned to the new device until after running 'rebalance'. This is so you
can make multiple device changes and rebalance them all just once.
使用给出的信息添加新的设备到ring上。add操作不会分配partitions到新的设备上,只有运行了'rebalance'命令后才会进行分区的分配。
因此,这种机制可以允许你一次添加多个设备,并只执行一次rebalance实现对这些设备的分区分配。
swift-ring-builder <builder_file> create <part_power> <replicas> <min_part_hours>
Creates <builder_file> with 2^<part_power> partitions and &l