Skip to content

Commit 17b7cfe

Browse files
committed
Fixed cassandra not binding to docker ip address and added Authentication to cassandra
1 parent e014810 commit 17b7cfe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cassandra/src/start-cass.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,16 @@
44
mkdir -p /var/lib/cassandra
55
chown cassandra:cassandra /var/lib/cassandra
66

7+
CONFIG=/etc/cassandra
8+
9+
IP=$(hostname --ip-address)
10+
sed -i -e "s,^listen_address.*,listen_address: $IP,g" $CONFIG/cassandra.yaml
11+
sed -i -e "s,^rpc_address.*,rpc_address: $IP,g" $CONFIG/cassandra.yaml
12+
sed -i -e "s,# broadcast_address.*,broadcast_address: $IP,g" $CONFIG/cassandra.yaml
13+
sed -i -e "s,# broadcast_rpc_address.*,broadcast_rpc_address: $IP,g" $CONFIG/cassandra.yaml
14+
sed -i -e "s,- seeds: \"127.0.0.1\",- seeds: \"$SEEDS\",g" $CONFIG/cassandra.yaml
15+
16+
sed -i -e "s,authenticator: AllowAllAuthenticator,authenticator: PasswordAuthenticator,g" $CONFIG/cassandra.yaml
17+
sed -i -e "s,authorizer: AllowAllAuthorizer,authorizer: CassandraAuthorizer,g" $CONFIG/cassandra.yaml
18+
719
exec setuser cassandra cassandra -f

0 commit comments

Comments
 (0)