There is currently no official release of Cassandra. You can either fetch a nightly build or check out the source and build it yourself.
- download the tarball from: http://hudson.zones.apache.org/hudson/job/Cassandra/lastSuccessfulBuild/artifact/cassandra/build/
- tar -zxvf cassandra*.tgz
Here is how to get started on the development trunk on a single local node:
- install jdk6 and Ant
- svn checkout https://svn.apache.org/repos/asf/incubator/cassandra/trunk cassandra-trunk
- ant (optional: ant test)
(JDK 1.6 is required. If you get an error like "class file has wrong version 50.0, should be 49.0" then ant is using 1.5 instead.)
Some people running OS X have trouble getting Java 6 to work. If you've kept up with Apple's updates, Java 6 should already be installed (it comes in Mac OS X 10.5 Update 1). Unfortunately, Apple does not default to using it. What you have to do is change your `JAVA_HOME` environment setting to `/System/Library/Frameworks/JavaVM.framework/Versions/1.6` and add `/System/Library/Frameworks/JavaVM.framework/Versions/1.6/bin` to the beginning of your `PATH`.
Start Cassandra on a single node
- edit conf/storage-conf.xml to your satisfaction. By default it will run on localhost and use /var/cassandra for data and logs (so create that directory and chown it appropriately if you want to keep things there).
- bin/cassandra to start (-f to start in foreground.)
- Go to http://localhost:7002 with your web browser. If cassandra is running you will get a (very rudimentary) admin console page. (This won't always be 127.0.0.1 or even localhost; Cassandra tries to guess your "real" hostname and listen on that. Sometimes it does not guess what you'd expect. We have a ticket to address this.)
Running on multiple nodes
- Edit conf/storage-conf.xml and add at least one of your node's public name or IP to the seed section.
- Make sure you are using hostnames that all the nodes can resolve. Each node logs what it is using with a line like "DEBUG - Starting to listen on jbe-ubuntu:7001". If Cassandra picks the wrong name then the easiest solution is to add that name to /etc/hosts for your cluster machines.
- Again, you can check http://localhost:7002 on each machine to make sure all the nodes see each other.
- the insert/retrieve interface on the web admin is for local inserts and lookups. So if you do an insert via thrift and then can't read it via the web, it's probably because it's actually on another node.
- you may want to edit conf/log4j.properties. by default, even in background mode it will log some things to stdout as it starts up. you can take out the stdout appender if this bugs you, and/or turn the default level from DEBUG down to INFO.
- data model explains the Cassandra ColumnFamily data model
- ThriftInterface gives examples for acessing and modifying data. If you are writing a Java client, Cassandra comes with libthrift.jar and the Thrift client classes you will need. Otherwise you will need to InstallThrift and generate the client code for your language of choice. (Thrift supports a lot of languages, including C++, C#, Erlang, Haskell, Java, Objective C, OCaml, Perl, PHP, Python, Ruby, and Squeak.)