Creating a Cassandra data store on Linux on Power (ppc64le)
You can install the Cassandra operator and set up the data store.
- Before you begin
- Cassandra operator versions and image tags for deployment
- Installing the Cassandra operator online
- Installing Cassandra offline
- Deploying and verifying Cassandra (online and offline)
Before you begin
Make sure that you prepared your online and offline host to pull images from the external repository. Also, ensure that the correct Helm repo is added.
For more information, see Preparing for data store installation.
Installing the Cassandra operator online
To install the Cassandra operator in an online environment, complete the steps for your platform.
Create Security Context Constraints
If you are using a Red Hat® OpenShift® cluster, create Security Context Constraints (SCC) before you deploy the Cassandra operator.
To create SCCs, complete the following steps:
-
Create a file, such as
cassandra-scc.yaml
, as follows:apiVersion: security.openshift.io/v1 kind: SecurityContextConstraints metadata: name: cassandra-scc runAsUser: type: MustRunAs uid: 999 seLinuxContext: type: RunAsAny fsGroup: type: RunAsAny allowHostDirVolumePlugin: false allowHostNetwork: true allowHostPorts: true allowPrivilegedContainer: false allowHostIPC: true allowHostPID: true readOnlyRootFilesystem: false users: - system:serviceaccount:instana-cassandra:cass-operator - system:serviceaccount:instana-cassandra:default
-
Apply the file by running the following command:
kubectl apply -f cassandra-scc.yaml
Install Cassandra
Complete these steps to install the Cassandra data store.
-
Create the
instana-cassandra
namespace:kubectl create namespace instana-cassandra
-
Create image pull secrets. Update the
<download_key>
value with your own download key.kubectl create secret docker-registry instana-registry --namespace instana-cassandra \ --docker-username=_ \ --docker-password=<download_key> \ --docker-server=artifact-public.instana.io
-
Install the Cassandra operator.
helm install cass-operator instana/cass-operator -n instana-cassandra --create-namespace --version=0.47.0 --set securityContext.runAsGroup=999 --set securityContext.runAsGroup=999 --set securityContext.runAsUser=999 --set image.registry=artifact-public.instana.io --set image.repository=ppc64le-oss/cass-operator-ppc64le --set image.tag=v1.19.0 --set appVersion=1.19.0 --set imageConfig.k8ssandraClient=artifact-public.instana.io/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 --set imageConfig.systemLogger=artifact-public.instana.io/ppc64le-oss/system-logger-ppc64le:v1.19.0 --set imagePullSecrets[0].name="instana-registry"
-
Create a YAML file, for example
cassandra.yaml
, with the Cassandra configuration.apiVersion: cassandra.datastax.com/v1beta1 kind: CassandraDatacenter metadata: name: cassandra spec: clusterName: instana serverType: cassandra serverImage: artifact-public.instana.io/ppc64le-oss/cass-management-api-ppc64le:4.1.2 systemLoggerImage: artifact-public.instana.io/ppc64le-oss/system-logger-ppc64le:v1.19.0 k8ssandraClientImage: artifact-public.instana.io/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 serverVersion: "4.1.2" imagePullPolicy: IfNotPresent podTemplateSpec: spec: imagePullSecrets: - name: instana-registry containers: - name: cassandra managementApiAuth: insecure: {} size: 3 allowMultipleNodesPerWorker: false storageConfig: cassandraDataVolumeClaimSpec: accessModes: - ReadWriteOnce resources: requests: storage: 200Gi config: jvm-server-options: initial_heap_size: "12G" max_heap_size: "12G" additional-jvm-opts: - -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true cassandra-yaml: authenticator: org.apache.cassandra.auth.PasswordAuthenticator authorizer: org.apache.cassandra.auth.CassandraAuthorizer role_manager: org.apache.cassandra.auth.CassandraRoleManager memtable_flush_writers: 8 auto_snapshot: false gc_warn_threshold_in_ms: 10000 otc_coalescing_strategy: DISABLED memtable_allocation_type: offheap_objects num_tokens: 256 drop_compact_storage_enabled: true
-
Complete the steps in Deploying and verifying Cassandra (online and offline).
Installing Cassandra offline
If you didn't yet pull the Cassandra images from the external registry when you prepared for installation, you can pull them now. Run the following commands on your bastion host. Then, copy the images to your Instana host that is in your air-gapped environment.
docker pull artifact-public.instana.io/ppc64le-oss/cass-operator-ppc64le:v1.19.0
docker pull artifact-public.instana.io/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2
docker pull artifact-public.instana.io/ppc64le-oss/cass-management-api-ppc64le:4.1.2
docker pull artifact-public.instana.io/ppc64le-oss/system-logger-ppc64le:v1.19.0
Complete the following steps on your Instana host.
-
Retag the images to your internal image registry.
docker tag artifact-public.instana.io/ppc64le-oss/cass-operator-ppc64le:v1.19.0 <internal-image-registry>/ppc64le-oss/cass-operator-ppc64le:v1.19.0 docker tag artifact-public.instana.io/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 <internal-image-registry>/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 docker tag artifact-public.instana.io/ppc64le-oss/cass-management-api-ppc64le:4.1.2 <internal-image-registry>/ppc64le-oss/cass-management-api-ppc64le:4.1.2 docker tag artifact-public.instana.io/ppc64le-oss/system-logger-ppc64le:v1.19.0<internal-image-registry>/ppc64le-oss/system-logger-ppc64le:v1.19.0
-
Push the images to your internal image registry on your bastion host.
docker push <internal-image-registry>/ppc64le-oss/cass-operator-ppc64le:v1.19.0 docker push <internal-image-registry>/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 docker push <internal-image-registry>/ppc64le-oss/cass-management-api-ppc64le:4.1.2 docker push <internal-image-registry>/ppc64le-oss/system-logger-ppc64le:v1.19.0
-
Create the
instana-cassandra
namespace:kubectl create namespace instana-cassandra
-
Optional: Create an image pull secret if your internal image registry needs authentication.
kubectl create secret docker-registry <secret_name> --namespace instana-cassandra \ --docker-username=<registry_username> \ --docker-password=<registry_password> \ --docker-server=<internal-image-registry>:<internal-image-registry-port> \ --docker-email=<registry_email>
-
Install the Cassandra operator. If you created an image pull secret in the previous step, add
--set imagePullSecrets[0].name="<internal-image-registry-pull-secret>"
to the following command.helm install cass-operator cass-operator-0.47.0.tgz -n instana-cassandra --create-namespace --version=0.47.0 --set securityContext.runAsGroup=999 --set securityContext.runAsGroup=999 --set securityContext.runAsUser=999 --set image.registry=<internal-image-registry> --set image.repository=ppc64le-oss/cass-operator-ppc64le --set image.tag=v1.19.0 --set appVersion=1.19.0 --set imageConfig.k8ssandraClient=<internal-image-registry>/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 --set imageConfig.systemLogger=<internal-image-registry>/ppc64le-oss/system-logger-ppc64le:v1.19.0
-
Create a YAML file, for example
cassandra.yaml
, with the Cassandra configuration:apiVersion: cassandra.datastax.com/v1beta1 kind: CassandraDatacenter metadata: name: cassandra spec: clusterName: instana serverType: cassandra serverImage: <internal-image-registry>/ppc64le-oss/cass-management-api-ppc64le:4.1.2 systemLoggerImage: <internal-image-registry>/ppc64le-oss/system-logger-ppc64le:v1.19.0 k8ssandraClientImage: <internal-image-registry>/ppc64le-oss/k8ssandra-client-ppc64le:v0.2.2 serverVersion: "4.1.2" imagePullPolicy: IfNotPresent podTemplateSpec: spec: # Optional: if you created an image pull secret for your internal registry, uncomment the following lines and update the image pull secret information. # imagePullSecrets: # - name: <internal-image-registry-pull-secret> containers: - name: cassandra managementApiAuth: insecure: {} size: 3 allowMultipleNodesPerWorker: false storageConfig: cassandraDataVolumeClaimSpec: accessModes: - ReadWriteOnce resources: requests: storage: 200Gi config: jvm-server-options: initial_heap_size: "12G" max_heap_size: "12G" additional-jvm-opts: - -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true cassandra-yaml: authenticator: org.apache.cassandra.auth.PasswordAuthenticator authorizer: org.apache.cassandra.auth.CassandraAuthorizer role_manager: org.apache.cassandra.auth.CassandraRoleManager memtable_flush_writers: 8 auto_snapshot: false gc_warn_threshold_in_ms: 10000 otc_coalescing_strategy: DISABLED memtable_allocation_type: offheap_objects num_tokens: 256 drop_compact_storage_enabled: true
-
Complete the steps in Deploying and verifying Cassandra (online and offline).
Deploying and verifying Cassandra (online and offline)
When you deploy Cassandra, the CassandraDatacenter by default creates a superuser, for example <clustername>-superuser
. The <clustername>
is the value that is specified in .spec.clusterName
section in the cassandra.yaml
file. In the following commands, the secret name instana-superuser
is used as an example.
To deploy the Cassandra instance and create the data store, complete the following steps:
-
Deploy Cassandra by running the following command.
kubectl apply -f cassandra.yaml --namespace=instana-cassandra
-
Retrieve the password of the
instana-superuser
.kubectl get secret instana-superuser -n instana-cassandra --template='{{index .data.password | base64decode}}' && echo
-
Store the password in the
config.yaml
file. Replace<RETRIEVED_FROM_SECRET>
with the password that you got in the previous step.datastoreConfigs: ... cassandraConfigs: - user: instana-superuser password: <RETRIEVED_FROM_SECRET> adminUser: instana-superuser adminPassword: <RETRIEVED_FROM_SECRET> ...
-
Verify the deployment of the Cassandra data store.
kubectl get all -n instana-cassandra
-
If the Cassandra data store is deployed successfully, then the result of the command might be as the following output:
NAME READY STATUS RESTARTS AGE pod/cass-operator-57dcc8884f-92knc 1/1 Running 0 36m pod/instana-cassandra-default-sts-0 2/2 Running 0 26m pod/instana-cassandra-default-sts-1 2/2 Running 0 26m pod/instana-cassandra-default-sts-2 2/2 Running 0 26m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/cass-operator-webhook-service ClusterIP 192.168.1.55 <none> 443/TCP 36m service/instana-cassandra-additional-seed-service ClusterIP None <none> <none> 26m service/instana-cassandra-all-pods-service ClusterIP None <none> 9042/TCP,8080/TCP,9103/TCP,9000/TCP 26m service/instana-cassandra-service ClusterIP None <none> 9042/TCP,9142/TCP,8080/TCP,9103/TCP,9000/TCP 26m service/instana-seed-service ClusterIP None <none> <none> 26m NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/cass-operator 1/1 1 1 36m NAME DESIRED CURRENT READY AGE replicaset.apps/cass-operator-57dcc8884f 1 1 1 36m NAME READY AGE statefulset.apps/instana-cassandra-default-sts 3/3 26m