|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -# Accept listen_address |
4 | | -IP=${LISTEN_ADDRESS:-`hostname --ip-address`} |
5 | | -# Cassandr aConfig location |
6 | | -CONFIG=/etc/cassandra |
7 | | - |
8 | | -# Setup Cassandra params |
9 | | -sed -i -e "s/^listen_address.*/listen_address: $IP/" $CONFIG/cassandra.yaml |
10 | | -sed -i -e "s/^rpc_address.*/rpc_address: $IP/" $CONFIG/cassandra.yaml |
11 | | -sed -i -e "s/# broadcast_address.*/broadcast_address: $IP/" $CONFIG/cassandra.yaml |
12 | | -sed -i -e "s/# broadcast_rpc_address.*/broadcast_rpc_address: $IP/" $CONFIG/cassandra.yaml |
13 | | -sed -i -e "s/# native_transport_max_threads.*/native_transport_max_threads: 1024/" $CONFIG/cassandra.yaml |
14 | | -sed -i -e "s/^commitlog_segment_size_in_mb.*/commitlog_segment_size_in_mb: 64/" $CONFIG/cassandra.yaml |
15 | | -sed -i -e "s/- seeds: \"127.0.0.1\"/- seeds: \"$SEEDS\"/" $CONFIG/cassandra.yaml |
16 | | -sed -i -e "s/incremental_backups: false/incremental_backups: $ENABLE_INCREMENTAL_BACKUPS/g" $CONFIG/cassandra.yaml |
17 | | -sed -i -e "s/# JVM_OPTS=\"$JVM_OPTS -Djava.rmi.server.hostname=<public name>\"/ JVM_OPTS=\"$JVM_OPTS -Djava.rmi.server.hostname=$IP\"/" $CONFIG/cassandra-env.sh |
18 | | -#sed -i -e "s/# initial_token:.*/initial_token: $INITIAL_TOKEN/" $CONFIG/cassandra.yaml |
19 | | -sed -i -e "s/num_tokens.*/num_tokens: 256/" $CONFIG/cassandra.yaml |
20 | | -sed -i -e "s/^\(\\s*\)<appender-ref ref=\"ASYNCDEBUGLOG\" \/>/\\1<\!--<appender-ref ref=\"ASYNCDEBUGLOG\" \/>-->/" $CONFIG/logback.xml |
21 | | - |
22 | | -# SETUP CASSANDRA PORTS |
23 | | - |
24 | | -sed -i -e "s/^storage_port.*/storage_port: $INTERNODE_PORT/" $CONFIG/cassandra.yaml |
25 | | -sed -i -e "s/^rpc_port.*/rpc_port: $THRIFT_PORT/" $CONFIG/cassandra.yaml |
26 | | -sed -i -e "s/^native_transport_port.*/native_transport_port: $NATIVE_TRANSPORT_PORT/" $CONFIG/cassandra.yaml |
27 | | -sed -i -e "s/^JMX_PORT=\"7199\"/JMX_PORT=\"$JMXPORT\"/" $CONFIG/cassandra-env.sh |
28 | | - |
29 | | -if [[ $SNITCH ]]; then |
30 | | - sed -i -e "s/endpoint_snitch: SimpleSnitch/endpoint_snitch: $SNITCH/" $CONFIG/cassandra.yaml |
31 | | -fi |
32 | | -if [[ $DC && $RACK ]]; then |
33 | | - echo "dc=$DC" > $CONFIG/cassandra-rackdc.properties |
34 | | - echo "rack=$RACK" >> $CONFIG/cassandra-rackdc.properties |
35 | | -fi |
36 | | - |
37 | 3 | exec cassandra -f |
0 commit comments