Welcome back ! to NoSQL DB most of Software engineers know what is MongoDB – CouchDB
What is Cassandra ?
Cassandra is Apache project working in large platforms such as facebook
you can download it from here
1- Edit Configuration file from here
conf/cassandra.yaml
The distribution’s sample configuration conf/cassandra.yaml contains reasonable defaults for single node operation, but you will need to make sure that the paths exist fordata_file_directories, commitlog_directory, and saved_caches_directory.
It will be a good idea to change cluster_name to avoid unnecessary conflict with existing clusters.
initial_token. You can leave it blank, but I recommend you to set it to 0 if you are configuring your first node.
# Edit the next line to point to your logs directory log4j.appender.R.File=/var/log/cassandra/system.log
3- Edit cassandra-env.sh
Cassandra has JMX (Java Management Extensions) interface, and the JMX_PORT is defined in conf/cassandra-env.sh. Edit following line if you need.
# Specifies the default port over which Cassandra will be available for # JMX connections. JMX_PORT="7199"
#MAX_HEAP_SIZE="4G" #HEAP_NEWSIZE="800M"
Cassandra will need more than few GB heap for production use, but you can run it with smaller footprint for test drive. If you want to assign 128MB as max, edit the lines as following.
MAX_HEAP_SIZE="128M" HEAP_NEWSIZE="32M"
Press “Control-C” to stop Cassandra.
If you start up Cassandra without “-f” option, it will run in background, so you need to kill the process to stop.
bin/cassandra-cli is a interactive command line interface for Cassandra. You can define schema, store and fetch data with the tool. Run following command to connect to your Cassandra instance.
bin/cassandra-cli -h host -p rpc_port
example:
% bin/cassandra-cli -h 127.0.0.1 -p 9160