README.md 2.69 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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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

    $ make startup
    [ ... ]
    cassandra_1  | INFO  [main] 2021-10-22 15:03:13,459 StorageService.java:1564 - JOINING: Finish joining ring
    cassandra_1  | INFO  [main] 2021-10-22 15:03:13,616 Gossiper.java:1832 - Waiting for gossip to settle...
    cassandra_1  | INFO  [main] 2021-10-22 15:03:21,617 Gossiper.java:1863 - No gossip backlog; proceeding
    cassandra_1  | INFO  [main] 2021-10-22 15:03:21,977 NativeTransportService.java:68 - Netty using native Epoll event loop
    cassandra_1  | INFO  [main] 2021-10-22 15:03:22,048 Server.java:158 - Using Netty Version: [netty-buffer=netty-buffer-4.0.44.Final.452812a, netty-codec=netty-codec-4.0.44.Final.452812a, netty-codec-haproxy=netty-codec-haproxy-4.0.44.Final.452812a, netty-codec-http=netty-codec-http-4.0.44.Final.452812a, netty-codec-socks=netty-codec-socks-4.0.44.Final.452812a, netty-common=netty-common-4.0.44.Final.452812a, netty-handler=netty-handler-4.0.44.Final.452812a, netty-tcnative=netty-tcnative-1.1.33.Fork26.142ecbb, netty-transport=netty-transport-4.0.44.Final.452812a, netty-transport-native-epoll=netty-transport-native-epoll-4.0.44.Final.452812a, netty-transport-rxtx=netty-transport-rxtx-4.0.44.Final.452812a, netty-transport-sctp=netty-transport-sctp-4.0.44.Final.452812a, netty-transport-udt=netty-transport-udt-4.0.44.Final.452812a]
    cassandra_1  | INFO  [main] 2021-10-22 15:03:22,048 Server.java:159 - Starting listening for CQL clients on /0.0.0.0:9042 (unencrypted)...
    cassandra_1  | INFO  [main] 2021-10-22 15:03:22,111 CassandraDaemon.java:564 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it
    cassandra_1  | INFO  [main] 2021-10-22 15:03:22,111 CassandraDaemon.java:650 - Startup complete
    [ ... ]

Starts a single node Cassandra cluster as a container in the foreground and binds to 0.0.0.0:9042.


### Connecting with cqlsh

Running `cqlsh` from an (ephemeral) container:

    $ make cqlsh
    
Or optionally, to run `cqlsh` from the host:

    $ . py/bin/activate
    $ cqlsh

_NOTE: Use `deactivate` to leave the Python virtual environment._


### 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

To terminate the service, remove all associated state and containers:

    $ make shutdown