README.md 1.28 KB
Newer Older
Eevans's avatar
Eevans committed
1
2
# cassandra-env-scaffold

3
4
5
6
7
8
9
10
11
12
13
14
15
16
Scaffolding for projects that need a Cassandra development and/or testing environment.


## Requirements

- Docker & Docker Compose
- Make

On Debian-based systems, `apt install build-essential docker-compose` is probably sufficient.


## Usage

### Running
17
18
19
20
21
22
23
24
25
26
    
	$ make up
    docker-compose up -d
    Creating network "env-scaffold_cassandra" with the default driver
    Creating cassandra0 ... done
    Creating cassandra1 ... done
    Creating cassandra2 ... done
	$
    
Starts a three node Cassandra cluster in the background, binding to 0.0.0.0:904[2-4].
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


### Connecting with cqlsh

Running `cqlsh` from an (ephemeral) container:

    $ make cqlsh


### Creating schema & loading test data

    $ make bootstrap

The `bootstrap` target is a convenience that reads files with a `.cql` extension (in sort lexical order)
from `bootstrap.d`, and runs them with `cqlsh -f`.


### Shutting down

46
47
48
49
50
51
52
53
54
55
56
57
58
To terminate the cluser (and remove all associated state and containers):

    $ make down clean
    docker-compose down --remove-orphans
    Stopping cassandra2 ... done
    Stopping cassandra1 ... done
    Stopping cassandra0 ... done
    Removing cassandra2 ... done
    Removing cassandra1 ... done
    Removing cassandra0 ... done
    Removing network env-scaffold_cassandra
    $