Code Monkey home page Code Monkey logo

cassandra-cluster's Introduction

cassandra-cluster

test to create a cassandra cluster in a docker-compose setup. so that each app can call its own clustermember. And an attempt to do cqrs en that via the cluster the updated data is distributed to the other cluster members

inspiration from here: medium

See the docker-compose.yml

Start it up: docker-compose up or docker-compose -f docker-compose.yml up

Status containers: docker ps

Stats: docker stats

Get in the containers:

$ docker exec -it DSE-6_node1 bash
$ docker exec -it DSE-6_node2 bash
$ docker exec -it DSE-6_node3 bash

Status cassandra from within a container:

$ nodetool status

Describe keyspaces: cqlsh> DESC keyspaces;

Create keyspace from within a container:

$ cqlsh
cqlsh> CREATE KEYSPACE musicDb WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : '3'};

Use it:

cqlsh> USE musicDb;

Create table:

cqlsh> CREATE TABLE musics_by_genre (
                          genre VARCHAR,
                          performer VARCHAR,
                          year INT,
                          title VARCHAR,
                          PRIMARY KEY ((genre), performer, year, title)
                        ) WITH CLUSTERING ORDER BY (performer ASC, year DESC, title ASC);

Details table:

DESC TABLE musics_by_genre;

Put data into the table:

INSERT INTO musics_by_genre (genre, performer, year, title) VALUES ('Rock', 'Nirvana', 1991, 'Smells Like Teen Spirit');

Show data in table:

cqlsh:musicdb> SELECT * from musics_by_genre;

cassandra-cluster's People

Contributors

robharting avatar

Watchers

 avatar

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.