With the recent release of vCloud Availability for vCloud Director 2.0, it seems like a good opportunity to review the steps for one of the key components required for its installation, the Cassandra database cluster. While the vCloud Availability installation provides a container based deployment of Cassandra, this container instance of Cassandra is only meant for ‘proof of concept’ deployments.
To support a production implementation of vCloud Availability, a fully clustered instance of Cassandra must be deployed with a recommend minimum of 3 nodes. This post will outline the steps for prepping the nodes for the installation of Cassandra. These preparation steps consist of:
- Installation of Java JDK 8
- Installation of Python 2.7
This post assumes basic proficiency with the ‘vi’ text editor.
Before deploying the Cassandra nodes for vCloud Availability, ensure that:
- All nodes have access to communicate with the vSphere Cloud Replication Service over ports 9160 and 9042.
- DNS is properly configured so that each node can successfully be resolved by the respective FQDN.
It is also worth mentioning that for this implementation, Cassandra does not require a load balancer as the vSphere Cloud Replication Service will automatically select an available node from the Cassandra cluster database communications.
Deploy Linux Virtual Machines
First you will need to deploy at least 3 Linux VMs for the installation, CentOS 7 will be used for the purposes of this post.
On the first Cassandra node, install Java 1.8.X in the /opt directory. To locate the link for your preferred version of Java, open a browser to the Java SE downloads page (here) scroll to the version of Java that you intend to install and click the JDK Download button for the version. At the Development Kit Downloads page, identify the product/file description of description for updated version of Java, review and accept the license agreement, then right click the link of the download (the correct link to the download file can only be copied after the Review and Accept the License agreement).
Note: There are multiple methods for successfully installing Java on CentOS. For which ever method you choose, be sure to update the steps listed here for the correct root directory of the Java installation.
Open an SSH session on the first Cassandra node as root, then navigate to the /opt directory:
Next, type the following to download the Java installer and press Enter:
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151- b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
Once the file has been download, extract the file with the following tar command, make to use the name of the file that matches your version of Java:
tar xzf jdk-8u151-linux-x64.tar.gz
The next step is to download the Java Cryptography Extension (JCE) for the version of Java that is being installed. The link to the current policy file is at the download page here. Scroll down to the “Additional Resources” section, left click the download button next to the “Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for JDK/JRE 8”, Review and Accept the License Agreement, then right click the jce_policy8.zip file and copy the link location.
Back at the SSH session, type following at the command prompt and press Enter:
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip
Next Unzip the policy file:
Copy the extracted files to the security directory of the Java installation (your jdk directory names may vary based on the version of Java Download, the example shows version 8u151):
cp UnlimitedJCEPolicyJDK8/*.jar \
Next, change directory to the root of the Java installation directory:
Type the following command to install Java:
alternatives --install /usr/bin/java java /opt/jdk1.8.0_151/bin/java 2
Then set the default version of Java with the following command:
alternatives --config java
At the prompt, type the Selection number for the installed version of Java and press Enter.
Once Java has been installed, verify the Java version with the following command to ensure that the correct version of Java is displayed.
Download and Install Python 2.7
To start, check Python to determine which version of Python is installed:
If Python 2.7 is not installed or you wish to update to the most recent version of Python 2.7, proceed with the following steps.
First install the Software Collection (SCL) release package:
yum install –y centos-release-scl
Now that the preparations for python are complete, use the next command to perform the actual installation of Python 2.7:
yum install python27
Next, enable python with the following command
scl enable python27 bash
After the installation of Python is successful, add the site packages director to the usrlocal.pth file with the following command:
echo "/usr/lib/python2.7/site-packages/" > \ /opt/rh/python27/root/usr/lib/python2.7/site-packages/usrlocal.pth
It is important to complete these steps on all 3 nodes that will be part of the Cassandra cluster before proceeding to complete the installation of Cassandra.
This concludes the node preparation steps for Cassandra. In the next post will outline the steps for installing Cassandra and completing the configuration for secure communication and clustered operations of the nodes.