Hello world for Cassandra with golang
The purpose of this tutorial is to execute a simple command on a Cassandra database.
Requirements
You need first to have a Cassandra service available. More information here
Certificate
You need to create a directory that will be mounted on the docker container. It must contains the following:
ca.certificate.pem
: the cluster certificate
Build and run
Once you have created your user, and set up your IP restrictions you can run the following:
read USER
read -s PASSWORD
read HOST
read PORT
## PATH_TO_CERTIFICATES must be a directory containing the certificate
read PATH_TO_CERTIFICATES
docker build -t cassandra-go-hello-world .
docker run -v $PATH_TO_CERTIFICATES:/certificates cassandra-go-hello-world $HOST $PORT $USER $PASSWORD
Dependencies
This example is using the following external dependencies: