Es necesario descargar Cassandra Cluster Manager SUBIDO EN GITHUB
Hemos descargado los más recientes de todo
A working python installation (tested to work with python 2.7).
pyYAML (http://pyyaml.org/ descarga y descomprime y te vas a la carpeta de descompresión -- sudo easy_install pyYaml)
o bien sudo python setup.py install
six (https://pypi.python.org/pypi/six descarga y descomprime y te vas a la carpeta de descompresión -- sudo easy_install six)
o bien sudo python setup.py install (no, no es un error)
ant (http://ant.apache.org/, on Mac OS X, brew install ant)
psutil (https://pypi.python.org/pypi/psutil)
Java (which version depends on the version of Cassandra you plan to use. If unsure, use Java 7 as it is known to work with current versions of Cassandra).
Problemas: easy_install no es un comando válido, en askubuntu dan esta solución:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-setuptools
Después de todo esto ya podemos usar el CCM:
ccm uses python distutils so from the source directory run:
Let's say you wanted to fire up a 3 node Cassandra cluster.
ccm create test -v 2.0.5 -n 3 -s
You will of course want to replace 2.0.5 by whichever version of Cassandra you want to test.
El 3 marca que se estám creando 3 nodos en el cluster (comprobar que es esa versión de Cassandra la que tenemos instalada)
Para mejor entendimiento de lo que se hace y configurar personalmente las opciones mejor seguir la versión larga:
ccm works from a Cassandra source tree (not the jars). There are two ways to tell ccm how to find the sources:
If you have downloaded and compiled Cassandra sources, you can ask ccm to use those by initiating a new cluster with:
ccm create test --install-dir=<path/to/cassandra-sources>
or, from that source tree directory, simply
You can ask ccm to use a released version of Cassandra. For instance to use Cassandra 2.0.5, run
ccm will download the source (from http://archive.apache.org/dist/cassandra), compile it, and set the new cluster to use it. This means that this command can take a few minutes the first time you create a cluster for a given version. ccm saves the compiled source in ~/.ccm/repository/, so creating a cluster for that version will be much faster the second time you run it (note however that if you create a lot of clusters with different versions, this will take up disk space).
Once the cluster is created, you can populate it (with 3 nodes) and start all the nodes with:
ccm populate -n 3 ccm start
That will start 3 nodes on IP 127.0.0.[1, 2, 3] on port 9160 for thrift, port 7000 for the internal cluster communication and ports 7100, 7200 and 7300 for JMX. You can check that the cluster is correctly set up with
You can then bootstrap a 4th node with
ccm add node4 -i 127.0.0.4 -j 7400 -b
(populate is just a shortcut for adding multiple nodes initially)
ccm provides a number of conveniences, like flushing all of the nodes of the cluster:
You can also easily look at the log file of a given node with:
Finally, you can get rid of the whole cluster (which will stop the node and remove all the data) with
The list of other provided commands is available through
Each command is then documented through the -h (or --help) flag. For instance ccm add -hdescribes the options for ccm add.