<installation location>
<installation location>/bin/cassandra
OR start Cassandra as a service - [sudo] service cassandra start
<installation location>/bin/nodetool status
.Ex:
cassandra.bat
file to start Cassandra server and cqlsh.bat
to open CQL client terminal to execute CQL commands.There are two ways that installation for a Single Node can be carried out.
You should have Oracle Java 8 or OpenJDk 8 (preferred for Cassandra versions > 3.0)
Add the Cassandra version to the repository (replace the 22x with your own version for example for 2.7 use 27x)
echo "deb-src http://www.apache.org/dist/cassandra/debian 22x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
# Update the repository
sudo apt-get update
# Then install it
sudo apt-get install cassandra cassandra-tools
Now Cassandra can be started and stopped using:
sudo service cassandra start
sudo service cassandra stop
Check the status using:
nodetool status
Logs and Data directories are /var/log/cassandra
and /var/lib/cassandra
respectively.
Download the Datastax version:
curl -L http://downloads.datastax.com/community/dsc-cassandra-version_number-bin.tar.gz | tar xz
Or Apache Cassandra binary tarball manually (from the site http://www.apache.org/dist/cassandra/)
Now untar this:
tar -xvzf dsc-cassandra-version_number-bin.tar.gz
Change the directory to install location:
cd install_location
Start Cassandra using:
sudo sh ./bin/cassandra
Stop using:
sudo kill -9 pid
Check:
./bin/nodetool status
And viola, you have a single-node test cluster for Cassandra. So just use cqlsh
in the terminal for Cassandra shell.
Configuration of Cassandra can be done in cassandra.yaml
in conf
folder in install_location
.