Giter Site home page Giter Site logo

cassandra-playground's Introduction

Cassandra playground

The repository contains short tutorial describing how to setup cassandra cluster on your local machine with Docker. Handy docker-compose.yaml is included, it is based on examples from DataStax.

Additionally it has some example CQL schemas and simple clients written in Python which make use of DataStax Cassandra driver.

Setup Cassandra cluster

  1. Navigate to repository root folder

  2. Tweak docker-compose.yaml settings (especially memory limits for nodes)

  3. Get the Cassandra Docker images from docker hub (DSE = DataStax Enterprise, one of Cassandra distributions, free of charge for development use)

     docker pull datastax/dse-server:latest
     docker pull datastax/dse-studio:latest
    
  4. Run DSE studio (management tool) and cassandra cluster with 4 nodes (one seed node and three others)

     docker-compose up --scale node=3
    

    If you want to run docker containers in background (detached mode), try instead

     docker-compose up -d --scale node=3
    

    Above command is similar to executing these two sets of commands, one for running the cluster

     docker run -e DS_LICENSE=accept -e JVM_EXTRA_OPTS="-Xms1g -Xmx4g" --name cassandra-node1 -d datastax/dse-server
     docker run -e DS_LICENSE=accept -e JVM_EXTRA_OPTS="-Xms1g -Xmx4g" -e SEEDS=cassandra-node1 --name cassandra-node2 --link cassandra-node1 -d datastax/dse-server 
     docker run -e DS_LICENSE=accept -e JVM_EXTRA_OPTS="-Xms1g -Xmx4g" -e SEEDS=cassandra-node1 --name cassandra-node3 --link cassandra-node1 -d datastax/dse-server
     docker run -e DS_LICENSE=accept -e JVM_EXTRA_OPTS="-Xms1g -Xmx4g" -e SEEDS=cassandra-node1 --name cassandra-node4 --link cassandra-node1 -d datastax/dse-server
    

    and another for running the DataStax Studio

     docker run -e DS_LICENSE=accept -e JVM_EXTRA_OPTS="-Xms512m -Xmx1g" --link cassandra-node1 -p 9091:9091 --name dse-studio -d datastax/dse-studio
    
  5. Shutdown the cluster and DSE studio

     docker-compose down
    

Useful commands

docker exec -it cassandra-playground_seed-node_1 nodetool status
docker exec -it cassandra-playground_seed-node_1 nodetool getendpoints shopping purchase_history 'Gdansk'

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.