Tuesday, April 26, 2011

Cassandra installation on windows 7

1. Cassandra is java based application, so first of all you need to install java on your machine.
Latest JRE you can download from here: http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Download Cassandra binary files from here: http://cassandra.apache.org/download/

3. Extract Cassandra source files. e.g. to D:\cassandra

4. set environment variables. (Go to System Properties -> Tab Advanced -> button Environment Variables ... and add system variables here)
JAVA_HOME=c:\Program Files\Java\jre6\ (it should be path to jre directory, not to bin directory ... value I used can be different on your machine)
CASSANDRA_HOME=d:\cassandra

5. modify config file d:\cassandra\conf\storage-conf.xml
I changed following:
/var/lib/cassandra/commitlog
to
d:/cassandra/commitlog
also I created directory d:/cassandra/commitlog

Next change was:
/var/lib/cassandra/data
I changed it to

d:/cassandra/data
and again I created directory d:/cassandra/data

6. You are ready to start Cassandra
Go to directory d:\cassandra\bin\ and start cassandra.bat

You should see output like this:
D:\cassandra\bin>cassandra.bat
Starting Cassandra Server
Listening for transport dt_socket at address: 8888
INFO 13:47:17,274 DiskAccessMode 'auto' determined to be mmap, indexAccessMode
is mmap
INFO 13:47:17,808 Saved Token not found. Using 15738447088364600050102917327157
1041806
INFO 13:47:17,809 Saved ClusterName not found. Using Test Cluster
INFO 13:47:17,815 Creating new commitlog segment d:/cassandra/commitlog\CommitL
og-1280922437815.log
INFO 13:47:17,886 LocationInfo has reached its threshold; switching in a fresh
Memtable at CommitLogContext(file='d:/cassandra/commitlog\CommitLog-128092243781
5.log', position=419)
INFO 13:47:17,903 Enqueuing flush of Memtable-LocationInfo@1370440457(169 bytes
, 4 operations)
INFO 13:47:17,905 Writing Memtable-LocationInfo@1370440457(169 bytes, 4 operati
ons)
INFO 13:47:18,082 Completed flushing d:\cassandra\data\system\LocationInfo-1-Da
ta.db
INFO 13:47:18,122 Starting up server gossip
INFO 13:47:18,196 Binding thrift service to localhost/127.0.0.1:9160
INFO 13:47:18,204 Cassandra starting up...

No comments:

Post a Comment