Scale Up Cassandra in different versions of OpenShift
For Red Hat OpenShift Enterprise version 3.1 and 3.2, and Red Hat OpenShift Container Platform version 3.3 and 3.4
-
As per the This page is not included, but the link has been rewritten to point to the nearest parent document.documentation for this, you will need to use a template that should be in the
openshift-infraproject. You can check this with the following command:# oc get template --all-namespaces | grep cassandra openshift-infra hawkular-cassandra-node-emptydir 4 (1 blank) 1 openshift-infra hawkular-cassandra-node-pv 6 (1 blank) 2 openshift-infra hawkular-cassandra-services 0 (all set) 2 -
If you have persistent storage setup for your existing cassandra instance, you will need to create a New PersistentVolume and will then use the
hawkular-cassandra-node-pvtemplate. Please take note of the storage size, we will use this later. -
If you are not using persistent storage, you will simply use the
hawkular-cassandra-node-emptydirtemplate -
After determining which template to use, and creating any PVs, you will then need to process the template, adding the various, important, variables:
# If not using persistent storage, the only variable that needs to be set is the number of cassandra pods you need: oc process hawkular-cassandra-node-emptydir NODE=# | oc create -f - # If using persistent storage, you will need to specify the number of cassandra pods you need as well as the size of the PV created: oc process hawkular-cassandra-node-pv NODE=2 PV_SIZE=50Gi | oc create -f -
For OpenShift Container Platform version 3.5 and above
- To properly scale up and have two replicas of Cassandra, you will need to create a new, separate PV so this second Cassandra instance has persistent storage, as well, and then run the metrics install playbook and add this option with
-e openshift_metrics_cassandra_replicas=2as well as the options for the storage.
For example:
ansible-playbook [-i </path/to/inventory>] <OPENSHIFT_ANSIBLE_DIR>/byo/openshift-cluster/openshift-metrics.yml \
-e openshift_metrics_install_metrics=True \
-e openshift_metrics_cassandra_replicas=2 \
-e openshift_metrics_cassandra_storage_type=pv \
-e openshift_metrics_cassandra_pvc_size=1Ti