Skip to content

Commit 740e942

Browse files
pranav-patilPranav Patil
authored andcommitted
Update docker compose configuration for cassandra cluster
1 parent 837c310 commit 740e942

File tree

6 files changed

+1284
-22
lines changed

6 files changed

+1284
-22
lines changed

data-service/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Data service provides various services to save and fetch data from [Apache Cassa
1212
* Go to `CASSANDRA_HOME\bin` directory and execute the command `cassandra.bat` to run cassandra.
1313
* Cassandra runs on default port 9042.
1414
* To enabled Authentication for Cassandra database, open `conf/cassandra.yaml` configuration file and update the below properties with these values.
15-
* **authenticator: org.apache.cassandra.auth.PasswordAuthenticator**
16-
* **authorizer: org.apache.cassandra.auth.CassandraAuthorizer**
15+
* **authenticator: PasswordAuthenticator**
16+
* **authorizer: CassandraAuthorizer**
1717

1818
All the above steps can be executed directly by running below runCassandra gradle task for windows.
1919

data-service/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
runtime('com.h2database:h2')
5656
testCompile('org.springframework.boot:spring-boot-starter-test')
5757
testCompile('io.projectreactor:reactor-test')
58-
apt "org.mapstruct:mapstruct-processor:${mapstructVersion}"
58+
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
5959
}
6060

6161
dependencyManagement {

data-service/cassandra-config/cassandra-init.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
22

3-
CQL="DROP keyspace testdb;
4-
CREATE KEYSPACE testdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
5-
ALTER USER cassandra WITH PASSWORD 'admin123';
6-
CREATE USER appuser WITH PASSWORD 'test123';
7-
GRANT ALL ON KEYSPACE testdb TO appuser;"
3+
CQL="DROP keyspace $CASSANDRA_APP_KEYSPACE;
4+
CREATE KEYSPACE $CASSANDRA_APP_KEYSPACE WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
5+
CREATE ROLE $CASSANDRA_APP_USERNAME WITH SUPERUSER = false AND LOGIN = true AND PASSWORD = '$CASSANDRA_APP_PASSWORD';
6+
GRANT ALL ON KEYSPACE $CASSANDRA_APP_KEYSPACE TO $CASSANDRA_APP_USERNAME;
7+
CREATE ROLE $CASSANDRA_ROOT_USERNAME WITH SUPERUSER = true AND LOGIN = true AND PASSWORD = '$CASSANDRA_ROOT_PASSWORD';
8+
ALTER ROLE cassandra WITH SUPERUSER = false AND LOGIN = false;
89
910
until echo $CQL | cqlsh; do
1011
echo "cqlsh: Cassandra is unavailable to initialize - will retry later"

0 commit comments

Comments
 (0)