Reducing replication on Openstack Swift

346 Views Asked by At

Is it possible to limit replication on OpenStack Swift to one or possibly 2? 3 data replicas are currently being created.

1

There are 1 best solutions below

1
Stephen C On

The default replication in Swift is 3 replicas, but you can change that to any number greater or equal to 1. The swift-ring-builder command has a set-replicas verb for adjusting the number of replicas; see

Of course, there is a tradeoff between the number of replicas and your cluster's ability to cope with loss of disk drives and servers.


You also asked this:

If I don't want replication on Openstack Swift(replication equal to 1), can I achieve this by disabling replicators? sudo swift-init object-replicator stop If I may, is this a better option?

I guess it would probably work ... until someone or something restarts the replicators.

But it is not a good idea:

  1. Monitoring may complain that the replicators are not working(!)

  2. Other swift tools may complain that the cluster is out of spec; e.g. swift-recon --replication.

  3. If you have been previously running with (say) a 3 replica policy, then nothing will delete the (now) redundant replicas created before you turned off the replicators.