Checking cluster health

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.

Getting ready

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

How to do it...

Carry out the following steps to set up the swift-dispersion tool to report on cluster health:

  1. We create the configuration file (/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

    Tip

    We're using keystone_api_insecure in this environment because we are using a self-signed certificate for our keystone endpoint. This skips the validation of the certificate.

  2. Now, we need to create containers and objects throughout our cluster so that they are in distinct places. We use the swift-dispersion-populate tool, as follows:
    sudo swift-dispersion-populate
    

    This produces an output similar to the following:

    How to do it...
  3. Once these containers and objects have been set up, we can run swift-dispersion-report:
    sudo swift-dispersion-report
    

    This produces the following report output:

    How to do it...
  4. We then set up a 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
    

How it works...

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset