Installing Cassandra DB for collecting vCD 9.0 Metrics Data

Cassandra DB is needed for capturing and storing vCloud Director metrics data so that it can be displayed in portal to end users so that users are aware of VM resource utilization etc.

Prior to vCD v9.0, we needed kairosdb + cassandra together for capturing and storing the metrics data, but things have changed now. VMware has removed the requirement of kairosdb and now metrics data can be sent straight to cassandra database.  This metric data in turn can be viewed in tenant UI.

As per vCD 9.0 documentation 

Cassandra is an open source database that you can use to provide the backing store for a scalable, high-performance solution for collecting time series data like virtual machine metrics. If you want vCloud Director to support retrieval of historic metrics from virtual machines, you must install and configure a Cassandra cluster and use the cell-management-tool to connect the cluster to vCloud Director. Retrieval of current metrics does not require optional database software.

If you are new to Cassandra, then In past I have wrote some blog posts about cassandra architecture and how it works. Feel free to read those posts from below links:

1:Introduction to cassandra

2: Understanding Cassandra Read/Write Mechanism

3: Installing Cassandra on RHEL6

In production you may want a Cassandra cluster with minimum 3-4 nodes, but in lab environment 1 or two nodes is sufficient. In my lab I am running only two node. I am configuring Cassandra on my CentOS 6 box.

vCD 9.0 needs Cassandra version 2.2.6 which can be downloaded from here

Before installing cassandra, we need to install jdk 1.7 or later and set the JAVA_HOME variable. Instructions for this is covered in blog link given above. Although the same blog have steps for installing cassandra, I am including the steps here as well.

Follow below steps for a successful installation of cassandra.

1: Create cassandra user with sudo permissions.

You can use below script which will create a user on server with sudo permissions.

2: Verify presence of cassandra user/group

3: Extract cassandra zip file and setup cassandra directory structure

4: Set ownership of directories to cassandra

5: Create script for installing cassandra as a service

Create a file named cassandra with below contents:

6: Add cassandra to chkconfig 

7: Modify cassandra.yaml file as shown below

8: Start Cassandra service 

Now cassandra node is configured. Next is to configure vCD to send metrics data to cassandra. We will discuss this in Next post. 

I hope you find this post informational. Feel free to share this on social media if it is worth sharing. Be sociable 🙂