Skip to content

Instantly share code, notes, and snippets.

@memorycraft
Created March 8, 2013 17:02
Show Gist options
  • Select an option

  • Save memorycraft/5117989 to your computer and use it in GitHub Desktop.

Select an option

Save memorycraft/5117989 to your computer and use it in GitHub Desktop.
sed -i "1s/ip-.*//g" /etc/hosts
sed -i "1s/$/ $(hostname)/g" /etc/hosts
sed -i "s/^listen_address:.*$/listen_address: $(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)/" /usr/local/cassandra/conf/cassandra.yaml
sed -i "s/^initial_token:.*$/initial_token: $1/" /usr/local/cassandra/conf/cassandra.yaml
sed -i "s/^auto_bootstrap:.*$/auto_bootstrap: $2/" /usr/local/cassandra/conf/cassandra.yaml
sed -i "s/^ - seeds:.*/ - seeds: \"$3\"/" /usr/local/cassandra/conf/cassandra.yaml
/etc/init.d/cassandra start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment