We can measure the health of our cluster by using the swift-dispersion-report
tool. This is done by checking the set of our distributed containers to ensure that the objects are in their proper places within the cluster.
Ensure you are logged in to the swift-proxy
nodes. If you created this node with Vagrant, you can access it by using the following command:
vagrant ssh swift-proxy
Carry out the following steps to set up the swift-dispersion
tool to report on cluster health:
/etc/swift/dispersion.conf
) required by the swift-dispersion
tool, as follows:[dispersion] auth_url = https://192.168.100.200:5000/v2.0 auth_user = cookbook:admin auth_key = openstack auth_version = 2.0 keystone_api_insecure = yes
swift-dispersion-populate
tool, as follows:sudo swift-dispersion-populate
This produces an output similar to the following:
swift-dispersion-report
:sudo swift-dispersion-report
This produces the following report output:
cron
job that repeatedly checks the health of these containers and objects:echo "/usr/bin/swift-dispersion-report" | sudo tee -a /etc/cron.hourly/swift-dispersion-report
The health of objects can be measured by checking whether the replicas are correct. If our OpenStack Object Storage cluster replicates an object three times and two of these three objects are in the correct place, the object would be 66.66 percent healthy.
To ensure we have enough replicated objects in our cluster, we populate it with the swift-dispersion-populate
tool, which creates 2,621 containers and objects, thereby increasing our cluster size. Once in place, we can then set up a cron
job that will run hourly to ensure our cluster is consistent which therefore gives a good indication whether our cluster is healthy.
By setting up a cron
job on our proxy node (which has access to all our nodes), we can constantly measure the health of our entire cluster. In our example, the cron
job runs hourly, executing the swift-dispersion-report
tool.