How do you move data between a Cassandra and MariaDB pod in Kubernetes?

6/5/2019

I have installed Kubernetes with Minikube on my Windows laptop. I have downloaded and installed Cassandra and MariaDB using helm charts. Right now I have 1 Cassandra pod with a dummy table

  Name   Age
  Johan  25 
  Eric   18

I have created a similar empty table in my MariaDB pod

  Name Age

My goal is now to copy the data from the Cassandra Table, and ingest it into the MariaDB table.

How is this done in Kubernetes? I read somewhere that LogStash is the way to go, or is there another way of simply moving data from one pod to another? Do I have to open up any ports or anything for this to work? I have tried to find information about this, but I have a hard time understanding what solution is most suitable for this.

Thank you for any suggestions/tips!

-- kkss
cassandra
kubernetes
mariadb

1 Answer

6/5/2019

What you need to do is, to make sure your Cassandra deployment is exposed with a headless Service, i.e.

apiVersion: v1
kind: Service
metadata:
  labels:
    app: cassandra
  name: cassandra
spec:
  clusterIP: None
  ports:
  - port: 9042
  selector:
    app: cassandra

so it is accessible for other services withing the cluster by follwoing DNS record

cassandra.default.svc.cluster.local

And then you just run another container in the same cluster with Cassandra's ODBC driver tool(Spark SQL(OS), Simba’s ODBC driver(Enterprise)) to connect and transform data to MySQL

-- A_Suh
Source: StackOverflow