Database Reference
In-Depth Information
Launching a cluster with a script
Now that we have configured the machines and we know the cluster settings to carry out,
what snitch to use, and what the initial tokens should be, we'll download the latest Cas-
sandra installation on multiple machines, set it up, and start it. But it is too much work to
do this manually.
We will see a custom script that does all this for us—after all we are dealing with a large
amount of data and a large number of machines, so doing all of this manually can lead to
errors and can be exhausting (and more importantly, there's no fun!). This script is available
on GitHub at https://github.com/naishe/mastering-cassandra-v2 . You may tweak it as per
your needs and work with it.
There are two scripts: install_cassandra.sh and upload_and_execute.sh .
The former is the one that is supposed to be executed on the to-be Cassandra nodes, and the
latter is the one that uploads the former to all the nodes, passes the appropriate initial token,
and executes it. It is the latter that you need to execute on your local machine and make
sure both scripts are in the same directory from where you are executing. If you are plan-
ning to use this script, you may need to change a couple of variables at the top.
Here is the script configured to set up a three-node cluster on Amazon EC2 machines. Note
that it uses EC2Snitch , so it does not need to set up a snitch configuration file as it would
have if it was using PropertyFileSnitch or GossippingPropertyFileSn-
itch . If you are using those snitches, you may need to upload those files to appropriate
locations in remote machines too:
#install_cassandra.sh
#!/bin/bash
set -e
# This script does the following:
# 1. download cassandra
# 2. create directories
Search WWH ::




Custom Search