[Openstack] (Juno) Multiple rings Swift

Christian Schwede christian.schwede at enovance.com
Tue Dec 23 08:13:26 UTC 2014


On 22.12.14 21:00, Amit Anand wrote:
> Thanks Christian I think thats exactly what I needed - I will try and
> make 2 new rings and see how that works. You wouldnt per chance know
> how I would limit the replicas, ie 2 in the Paris region and 1 at HQ?
> I only want one replica to goto the HQ region... ... Also, if you
> notice i my command for the name i gave hq-ip# - do I have to use the
> naming convention r#z#-ip when I add?

Yes, the naming convention tells Swift in which region/zone the device
is located. For example:

swift-ring-builder object-1.builder add r1z5-192.168.1.1:6000/sda1_ 3000

r1: Region 1
z5: Zone 5
3000: weight of the device

Here is a small example with two regions, the first with two replicas,
the second region with one. The important thing is to assign 2/3 of the
total cluster weight to one region, and 1/3 to the other.

---

swift-ring-builder object-1.builder create 14 3 1

swift-ring-builder object-1.builder add r1z1-192.168.1.1:6000/sda1_ 3000
swift-ring-builder object-1.builder add r1z2-192.168.1.2:6000/sda1_ 3000

swift-ring-builder object-1.builder add r2z1-192.168.2.1:6000/sda1_ 3000

swift-ring-builder object-1.builder rebalance

swift-ring-builder object-1.builder list_parts r1
swift-ring-builder object-1.builder list_parts r2

---

This example is a perfect match (ie all partitions store two replicas in
region 1 and one replica in region 2); however due to roundings during
the calculation it might happen that there are a few partitions that
have two replicas in the smaller region. You can see the partition and
replica count using the "list_parts" command; you might need to tweak
your weight numbers a little bit depending on your setup.

Christian




More information about the Openstack mailing list