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.