[openstack-dev] [puppet] [Swift] Multiple proxy recipes will create out of sync rings
Mark Kirkwood
mark.kirkwood at catalyst.net.nz
Fri Jun 12 05:27:31 UTC 2015
I've looking at using puppet-swift to deploy a swift cluster.
Firstly - without
http://git.openstack.org/cgit/stackforge/puppet-swift/tree/tests/site.pp
I would have struggled a great deal more to get up and running, so a big
thank you for a nice worked example of how to do multiple nodes!
However I have stumbled upon a problem - with respect to creating
multiple proxy nodes. There are some recipes around that follow on from
the site.pp above and explicitly build >1 proxy (e.g
https://github.com/CiscoSystems/puppet-openstack-ha/blob/folsom_ha/examples/swift-nodes.pp)
Now the problem is - each proxy node does a ring builder create, so ends
up with *different* builder (and therefore) ring files. This is not
good, as the end result is a cluster with all storage nodes and *one*
proxy with the same set of ring files, and *all* other proxies with
*different* ring (and builder) files.
I have used logic similar to the attached to work around this, i.e only
create rings if we are the 'ring server', otherwise get 'em via rsync.
Thoughts?
Regards
Mark
-------------- next part --------------
# create the ring if we are the ring server
if $ipaddress_eth0 == ringserver_local_net_ip {
class { 'swift::ringbuilder':
# the part power should be determined by assuming 100 partitions per drive
part_power => '18'
replicas => '2'
min_part_hours => 1
require => Class['swift'],
}
# sets up an rsync db that can be used to sync the ring DB
class { 'swift::ringserver':
local_net_ip => $ipaddress_eth0,
}
# exports rsync gets that can be used to sync the ring files
@@swift::ringsync { ['account', 'object', 'container']:
ring_server => $ipaddress_eth0,
}
} else {
# collect resources for synchronizing the ring databases
Swift::Ringsync<<||>>
}
More information about the OpenStack-dev
mailing list