Skip to content

Commit 43cdb4b

Browse files
Allow for a configurable replication factor for reaper_db
1 parent a3a2708 commit 43cdb4b

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,13 @@ node's status:
431431
432432
Once the Cassandra node is online and accepting CQL connections,
433433
create the required `reaper_db` Cassandra keyspace to allow Reaper to save
434-
its cluster and scheduling data:
434+
its cluster and scheduling data.
435435
436-
```docker-compose run initialize-reaper_db```
436+
By default, the `reaper_db` keyspace is created using a replication factor
437+
of 1. To change this replication factor, provide the intended replication
438+
factor as an optional argument:
439+
440+
```docker-compose run initialize-reaper_db [$REPLICATION_FACTOR]```
437441
438442
Wait a few moments for the `reaper_db` schema change to propagate,
439443
then start Reaper:
+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
FROM cassandra:3.11
22

3-
# create the required reaper_db keyspace to allow Reaper to store scheduling data
4-
CMD set -x \
5-
&& cqlsh cassandra -e \
6-
"CREATE KEYSPACE IF NOT EXISTS reaper_db WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };"
3+
# create the reaper_db keyspace
4+
COPY docker-entrypoint.sh /
5+
ENTRYPOINT ["/docker-entrypoint.sh"]
6+
7+
# use a default replication factor of 1
8+
CMD ["1"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
REPLICATION_FACTOR=$1
6+
7+
# create the required reaper_db keyspace to allow Reaper to store scheduling data
8+
cqlsh cassandra -e \
9+
"CREATE KEYSPACE IF NOT EXISTS reaper_db \
10+
WITH replication = {'class': 'SimpleStrategy', \
11+
'replication_factor': $REPLICATION_FACTOR };"

0 commit comments

Comments
 (0)