2015-02-16 14:48:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cassYml=$CASSANDRA_HOME/conf/cassandra.yaml
|
|
|
|
|
|
|
|
privateAddr=$(hostname -i)
|
|
|
|
|
|
|
|
seeds=${SEEDS:-${PUBLISH_AS:-$privateAddr}}
|
|
|
|
|
2016-04-17 17:21:53 +00:00
|
|
|
sed -i -e "s/- seeds:.*/- seeds: \"$seeds\"/" \
|
|
|
|
-e "s/listen_address:.*/listen_address: $privateAddr/" \
|
|
|
|
-e "s/rpc_address:.*/rpc_address: $privateAddr/" \
|
|
|
|
-e "s/start_rpc:.*/start_rpc: true/" \
|
|
|
|
-e "s#- /var/lib/cassandra/data#- $CASSANDRA_DATA#" \
|
|
|
|
$cassYml
|
2015-02-16 14:48:42 +00:00
|
|
|
|
|
|
|
if [ -n "$PUBLISH_AS" ]; then
|
|
|
|
sed -i -e "s/\(\s*#\)\?\s*broadcast_address:.*/broadcast_address: $PUBLISH_AS/" $cassYml
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy over our tweaked files, but non-clobbering to let user have ultimate control
|
|
|
|
cp -rn $CASSANDRA_HOME/conf/* $CASSANDRA_CONF
|
|
|
|
|
|
|
|
# source the original
|
|
|
|
. $CASSANDRA_HOME/bin/orig.cassandra.in.sh
|