Quickstart for Site Reliability Engineers
Tip
Be sure to first complete one of the K8ssandra install options (locally or on a cloud provider) before performing these post-install steps.In this quickstart for Site Reliability Engineers (SREs), we’ll cover:
- Accessing nodetool commands like status, ring, and info.
- Configure port forwarding for the Prometheus and Grafana monitoring utilities as well as Reaper for Apache Cassandra® (Reaper).
- Accessing the K8ssandra monitoring utilities, Prometheus and Grafana.
- Accessing Reaper, an easy to use repair interface.
- Upgrading a K8ssandra cluster: to ensure you’re using the latest K8ssandra software, or to apply new settings.
Access the Apache Cassandra® nodetool utility
Cassandra’s nodetool utility is commonly used for a variety of monitoring and management tasks. You’ll need to run nodetool on your K8ssandra cluster using the kubectl exec
command, because there’s no external standalone option available.
To run nodetool
commands:
-
Get a list of the running K8ssandra pods using
kubectl get
:Output:
The K8ssandra pod running Cassandra takes the form
<k8ssandra-cluster-name>-<datacenter-name>-default-sts-<n>
and, in the example above isk8ssandra-dc1-default-sts-0
which we’ll use throughout the following sections.Tip
Although not applicable to this quick start, additional K8ssandra Cassandra nodes will increment the final<n>
but the rest of the name will remain the same. -
Run
nodetool status
, using the Cassandra node namek8ssandra-dc1-default-sts-0
, and replacing<k8ssandra-username>
and<k8ssandra-password>
with the values you retrieved in Retrieve K8ssandra superuser credentials:Output:
Tip
All nodes should have the statusUN
or “Up Normal.”
Other useful nodetool commands include:
-
nodetool ring
which outputs all the tokens in the node:Output:
-
nodetool info
which provides load and uptime information:Output:
For details on all nodetool commands, see The nodetool utility.
Configure port forwarding
In order to access Cassandra utilities outside of the K8s cluster, if you don’t have an Ingress setup as described in Configure Ingress, you’ll need to configure port forwarding.
Begin by getting a list of your K8ssandra K8s services and ports:
Output:
In the output above, the services of interest are:
- k8ssandra-grafana: The K8ssandra grafana service where the name is a combination of the K8ssandra cluster name you specified during the Helm install,
k8ssandra
, and the postfix,-grafana
. This service listens on the internal K8s port80
. - prometheus-operated: The K8ssandra Prometheus daemon. This service listens on the internal K8s port
9090
. - k8ssandra-reaper-reaper-service: The K8ssandra Reaper service where the name is a combination of the K8ssandra cluster name you specified during the Helm install,
k8ssandra
,-reaper
, the K8ssandra cluster name again, and the postfix-reaper-service
. This port listens on the internal K8s port8080
.
To configure port forwarding:
-
Open a new terminal.
-
Run the following 3
kubectl port-forward
commands in the background:Output:
The K8ssandra services are now available at:
- Prometheus: http://127.0.0.1:9292
- Grafana: http://127.0.0.1:9191
- Reaper: http://127.0.0.1:9393/webui
Terminate port forwarding
To terminate a particular forwarded port:
-
Get the process ID:
Output:
-
Kill the process
Output:
Tip
Exiting the terminal instance will terminate all port forwarding services.Access K8ssandra monitoring utilities
K8ssandra deploys the following customized monitoring utilities:
- Prometheus a standard metrics collection and alerting tool.
- Grafana a set of preconfigured dashboards displaying important K8ssandra metrics.
Prometheus
To check on the health of your K8ssandra cluster using the K8ssandra Prometheus interface:
-
Access the Prometheus home page at http://127.0.0.1:9292:
-
From the Status menu, choose Targets.
-
Verify that the
stargate/0
andk8ssandra/0
are in the stateUP
:
For more details on Prometheus, see the Prometheus web site.
Grafana
To monitor the health and performance of your K8ssandra cluster using the pre-configured K8ssandra dashboards:
-
Retrieve the Grafana login username using the
helm show
command:Output:
-
Retrieve the Grafana login password using the
helm show
command:Output:
-
Access the Grafana login screen at http://127.0.0.1:9191 and login using the username and password:
-
Click the home button indicated by the arrow:
-
Click the
K8ssandra Overview
dashboard: -
The
K8ssandra Overview
dashboard is displayed: -
Explore the other K8ssandra dashboards.
For more information see the Grafana web site.
Access Reaper
Reaper is an easy interface for managing K8ssandra cluster repairs. Reaper is deployed as part of the K8ssandra install.
For details, start in the Reaper topic. Then read about the repair tasks you can perform with Reaper.
Upgrade K8ssandra
You can easily upgrade your K8ssandra software with the helm repo update
command, or apply new settings with the helm upgrade
command.
For details, see Upgrade K8ssandra.
Next steps
- FAQs: If you’re new to K8ssandra, these FAQs are for you.
- Components: Dig in to each deployed component of the K8ssandra stack and see how it communicates with the others.
- Tasks: Need to get something done? Check out the Tasks topics for a helpful collection of outcome-based solutions.
- Reference: Explore the K8ssandra configuration interface (Helm charts), the available options, and a Glossary.
We encourage SREs to actively participate in the K8ssandra community.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.