vCloud Availability for vCloud Director: Part 5: Deploy and Configure Cassandra Cluster

In the second post of this series, we discussed the components needed to form a VCAV solution stack, and we saw that Cassandra is an integral part of this solution. In this post, we will learn how to deploy a Cassandra Cluster.

If you are not following along with this series, then I recommend reading earlier posts of this series from the links below:

1: vCloud Availability Introduction

2: vCloud Availability Architecture & Components

3: VCAV Deployment

4: Install Cloud Proxy for vCD

 Before installing Cassandra software, we need to meet the following requirements:

1: Verify that routing, NTP, forward, and reverse DNS resolutions are working correctly.

2: Make sure that SELinux and your firewall are disabled. If they are enabled, then open appropriate ports in the firewall.

I have disabled SELinux and the firewall service in my lab. 

3: Install Python: Make sure Python 2.7 is installed in your CentOS 7 system. The default version of installed Python is 2.7.5

Note: If Python is not installed, then you can install it via yum by typing: # yum install python2 -y

4: Install Java: JDK 8u152 has been tested for Cassandra, and it works fine. It can be downloaded from here

5: Set JAVA_HOME Variable

6: Install Java Cryptography Extension (JCE): JCE increases the Java encryption level support.

If your Cassandra node has internet access and you have the wget utility installed, then JCE can be downloaded by running the following command:

Unzip the file by running the following command:

Note: If you get the error “unzip: command not found,” then you can install it by running the command # yum install zip unzip -y

Copy the unzipped JCE file to the respective directory by running the following command:

7: Install Cassandra via YUM 

Create the /etc/yum.repos.d/cassandra.repo file with the following content:

Install Cassandra by running the command: yum install cassandra -y

8: Fine-tune Cassandra: We need to make some configuration changes in Cassandra by editing the cassandra.yaml file. Make sure to back up the original file before making any changes.

# Enable Cassandra Service 

# Start the Cassandra service.

# Check the Cassandra service status.

# Check nodetool status to verify the node is up and has joined the cluster.

8: Cassandra Clustering: To add additional nodes to the Cassandra cluster, deploy a new CentOS 7 vm and repeat the above steps. In my lab, I have deployed only one Cassandra node. You can follow the instructions documented in this article for adding additional nodes.

Once the new node is fully configured, edit the cassandra.yaml file on both nodes and change the value of seed under the seed_provider section

And then restart the Cassandra service on all nodes. Verify that the node is operational by running the command: nodetool status  

9: Cassandra SSL Installation

1: Generate an SSL certificate by running the following command.

2: Export the Cassandra certificate to a PEM-formatted file.

3: Copy the .pem certificate file of each Cassandra node to the /root directory of the rest of the Cassandra nodes.

4: Import each certificate into the truststore of every Cassandra host.

5: Enable the server and the client communication with Cassandra over SSL. 

Edit /etc/cassandra/conf/cassandra.yaml configuration file and change the following values as shown below 

5a: Set the listen_address and rpc_address values to the Cassandra node IP address.

  • listen_address: Cass-Node-IP
  • rpc_address: Cass-Node-IP

5b: Update the values of the server_encryption_options properties.

Note: The keystore and truststore passwords are the same passwords that you used to create the keystore and the truststore.

5c: Update the values of the client_encryption_options properties.

5d: Restart the Cassandra node and make sure there are no errors reported in /var/log/cassandra/system.log. Last line of this log file usually reads as:

10: Enable cqlsh with SSL encryption 

10a: Import the Cassandra keystore into a new PKC12 keystore.

10b: Extract the certificate from the new PKC12 keystore.

10c: Extract the certificate key from the new PKC12 keystore.

10d: Create a /root/.cassandra/cqlshrc file with the following contents:

10e: Verify that you can use the cqlsh command

And that’s it for this post. In the next post of this series, we will deploy a RabbitMQ Cluster.

 I hope you enjoyed reading this post. Feel free to share this on social media if it’s worth sharing. 

Leave a Reply