Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatamiarash7/kubernetes-cassandra
Deploy Apache Cassandra in Kubernetes
https://github.com/hatamiarash7/kubernetes-cassandra
apache apache-cassandra cassandra cassandra-cluster cassandra-database database kubernetes
Last synced: 14 days ago
JSON representation
Deploy Apache Cassandra in Kubernetes
- Host: GitHub
- URL: https://github.com/hatamiarash7/kubernetes-cassandra
- Owner: hatamiarash7
- License: gpl-3.0
- Created: 2020-03-15T13:16:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T23:38:27.000Z (10 months ago)
- Last Synced: 2024-11-19T22:50:01.989Z (3 months ago)
- Topics: apache, apache-cassandra, cassandra, cassandra-cluster, cassandra-database, database, kubernetes
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes Cassandra
Deploy Apache Cassandra in Kubernetes## Install
We utilize a ["headless" service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) for Cassandra. This way we can provide a way for applications to access it via [KubeDNS](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) and not expose it to the outside. To access it from your developer workstation you can use `kubectl exec` commands against any of the cassandra pods.
If you do wish to connect an application to it you can use the KubeDNS value of `cassandra.default.svc.cluster.local` when configuring your application.```shell
kubectl create -f service.yaml
kubectl create -f volumes.yaml
kubectl create -f statefulset.yaml
```## Scaling
To increase or decrease the size of your StatefulSet you can use the scale command:
```shell
$ kubectl scale --replicas=3 statefulset/cassandra
```## Check Cluster
You can perform a `nodetool` status to check if the other cassandra nodes have joined and formed a Cassandra cluster.
```shell
$ kubectl exec -ti cassandra-0 -- nodetool statusDatacenter: DC1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.1.4.99 80.05 KiB 256 69.3% 528a11d5-74a4-4768-a1aa-70de5998449b Rack1
UN 10.1.4.98 74.94 KiB 256 61.9% 510c2b45-79ba-4717-8b7b-c7bc782fe6e7 Rack1
UN 10.1.4.101 236.12 KiB 256 68.9% 677859ee-ca59-42e1-9d6d-2632dfd3c13a Rack1
```## Check Cassandra
You can access the cassandra container using the following command:
```shell
$ kubectl exec -it cassandra-0 cqlshConnected to Cassandra at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh>
```Check tables :
```shell
cqlsh> describe tablesKeyspace system_traces
----------------------
events sessionsKeyspace system_schema
----------------------
tables triggers views keyspaces dropped_columns
functions aggregates indexes types columnsKeyspace system_auth
--------------------
resource_role_permissons_index role_permissions role_members rolesKeyspace system
---------------
available_ranges peers batchlog transferred_ranges
batches compaction_history size_estimates hints
prepared_statements sstable_activity built_views
"IndexInfo" peer_events range_xfers
views_builds_in_progress paxos localKeyspace system_distributed
---------------------------
repair_history view_build_status parent_repair_history
```