Skip to content

Commit 1da9a5c

Browse files
committed
Update Cassandra with Joe's suggestions
1 parent 8925315 commit 1da9a5c

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

cassandra/content.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Apache Cassandra is an open source distributed database management system design
1313
Starting a Cassandra instance is simple:
1414

1515
```console
16-
$ docker run --name some-%%REPO%% -d %%IMAGE%%:tag
16+
$ docker run --name some-%%REPO%% --network some-network -d %%IMAGE%%:tag
1717
```
1818

1919
... where `some-%%REPO%%` is the name you want to assign to your container and `tag` is the tag specifying the Cassandra version you want. See the list above for relevant tags.
@@ -23,15 +23,7 @@ $ docker run --name some-%%REPO%% -d %%IMAGE%%:tag
2323
Using the environment variables documented below, there are two cluster scenarios: instances on the same machine and instances on separate machines. For the same machine, start the instance as described above. To start other instances, just tell each new node where the first is.
2424

2525
```console
26-
$ docker run --name some-%%REPO%%2 -d -e CASSANDRA_SEEDS="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' some-%%REPO%%)" %%IMAGE%%:tag
27-
```
28-
29-
... where `some-%%REPO%%` is the name of your original Cassandra Server container, taking advantage of `docker inspect` to get the IP address of the other container.
30-
31-
Or you may use Docker networks to tell the new node where the first is:
32-
33-
```console
34-
$ docker run --name some-cassandra2 -d --network some-network %%IMAGE%%:tag
26+
$ docker run --name some-%%REPO%%2 -d --network some-network -e CASSANDRA_SEEDS=some-%%REPO%% %%IMAGE%%:tag
3527
```
3628

3729
For separate machines (ie, two VMs on a cloud provider), you need to tell Cassandra what IP address to advertise to the other nodes (since the address of the container is behind the docker bridge).
@@ -53,7 +45,7 @@ $ docker run --name some-%%REPO%% -d -e CASSANDRA_BROADCAST_ADDRESS=10.43.43.43
5345
The following command starts another Cassandra container instance and runs `cqlsh` (Cassandra Query Language Shell) against your original Cassandra container, allowing you to execute CQL statements against your database instance:
5446

5547
```console
56-
$ docker run -it --network some-network --rm %%IMAGE%% cqlsh some-cassandra
48+
$ docker run -it --network some-network --rm %%IMAGE%% cqlsh some-%%REPO%%
5749
```
5850

5951
More information about the CQL can be found in the [Cassandra documentation](https://cassandra.apache.org/doc/latest/cql/index.html).

0 commit comments

Comments
 (0)