As we could read in VMware blog it is quite usefull. and design should look like this:
But in my plans we will implement separately KairosDB and Cassandra VMs.
- Minimum cluster size is three nodes (must be equal or larger than the replication factor). Use scale out rather than scale up approach because Cassandra performance scales linearly with number of nodes.
- Estimate I/O requirements based on the expected number of VMs, and correctly size the Cassandra cluster and its storage.
n … expected number of VMs
m … number of metrics per VM (currently 8)
t … retention (days)
r … replication factor
Write I/O per second = n × m × r / 10
Storage = n × m × t × r × 114 kB
For 30,000 VMs, the I/O estimate is 72,000 write IOPS and 3288 GB of storage (worst-case scenario if data retention is 6 weeks and replication factor is 3).
Cassandra structure after installation is the following:
The packaged releases install into these directories:
|/etc/init.d||Service startup script|
|/etc/security/limits.d||Cassandra user limits|
Lets start installing Cassandra 3.0 , KairosDB and prerequisites for it!
We need to install Java 8 for Cassandra 3.0 and KairosDB first:
- We need to create repository list for java:
- Add the following repos to the list
- “apt-get update” – to update the repositories
- “apt-get install oracle-java8-installer -y” wait for installation to start installation. accept the licenses.
- After installation we shall check the Java version by running “Java -version” and get result
After Java installation we can install Cassandra:
- We need to create repository list for cassandra and add repositories in it:
echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
echo "deb http://debian.datastax.com/community stable main" | tee -a /etc/a pt/sources.list.d/cassandra.sources.list
- apt-get update – to update repositories
- apt-get install dsc30 – to install cassandra
- systemctl status cassandra
- systemctl stop cassandra – to stop the service
As we want to keep our database correctly we have to mount separate hdd to /var/lib/cassandra folder (as all the data located there):
- fdisk -l – to see all of the volumes install and search for /dev/sdb (c…)
- Now as we are sure that our device is called sdb and correct size shall run the following commands:
Command (m for help): o
Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 1
Command (m for help): w
- Now we have to map this disk to our lib folder for cassandra (as all of the data located there) we will use rsynch and fstab:
mount /dev/sdb1 /mnt/cassandra/
cp -ax /cassandra /mnt/cassandra/
mv cassandra/ cassandra.old
mount /dev/sdb1 cassandra
chown cassandra:cassandra cassandra
And add following line to the list:/dev/sdb1 /var/lib/cassandra ext4 defaults 0 1
As now we are done with preparing one cassandra node we can proceed and clone it to another 2 (as you remember minimal requirement is 3 nodes).
- To achieve this goal we need to run simple command in VMware powerCLI:
New-VM -name Cassandra03.demo.lab -VM $cassa -ResourcePool $RP
- Don’t forget to change hostnames and IP address in:
Now the time has come for configuring cassandra itself:
- Make sure that your nodes are not running by entering the command:
systemctl status cassandra
systemctl stop cassandra
- As we cloned our VMs we will have token conflicts inside of cluster so remove all the data by following commands:
rm -rf /var/lib/cassandra/commitlog/*
rm -rf /var/lib/cassandra/data/*
rm -rf /var/lib/cassandra/saved_caches/*
- Edit /etc/cassandra/cassandra.yaml
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
- seeds: "10.1.253.115,10.1.253.116,10.1.253.117"
- Edit /etc/cassandra/cassandra-rackdc.properties
- Edit /etc/cassandra/cassandra-topology.properties
- Do the same on other nodes (don’t forget to change the IP-addresses where required)
- After it we shall start cassandra service on nodes (one by one):
systemctl start cassandra
- You shall see the following picture when run the command:
Our Cassandra cluster is ready to recieve data from KairosDB which we gonna install now:
- Prepare Linux VM (as base system we use Debian – installation, configuration)
- Download and unpack KairosDB
wget https://github.com/kairosdb/kairosdb/releases/download/v1.1.3/kairosdb-1.1.3-1.tar.gz --no-check-certificate
tar -xzf kairosdb-1.1.3-1.tar.gz
- Attach additional vHDD and mount it (same as we did with cassandra)
mount /dev/sdb1 /var/lib/kairosdb/
mv kairosdb/* /var/lib/kairosdb/
Add the following:/dev/sdb1 /var/lib/kairosdb ext4 defaults 0 1
- Edit /var/lib/kairosdb/conf/kairosdb.properties
- Need first run KairosDB:
You will see the following picture:
- Now we have to start KairosDB in the background:
As a result we will see the following picture in our browser (dont forget default port is 8080)
Now we are on final step we have to show vCloud Director where to store data.
- First we have to disable
service vmware-vcd stop
./cell-management-tool configure-metrics --repository-host 10.1.253.118 --repository-port 8080
service vmware-vcd start ;tail -f /opt/vmware/vcloud-director/logs/cell.log
- After this is done give sometime for data to be collected and you can check metrics in KairosDB page.
Thank you for reading.