Skip to end of metadata
Go to start of metadata

Installing Cassandra

There is currently no official release of Cassandra. You can either fetch a nightly build or check out the source and build it yourself.

Nightly builds

  1. download the tarball from:
  2. tar -zxvf cassandra*.tgz

Here is how to get started on the development trunk on a single local node:

  1. install jdk6 and Ant
  2. svn checkout cassandra-trunk
  3. 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

  1. 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).
  2. bin/cassandra to start (-f to start in foreground.)
  3. 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 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

  1. Edit conf/storage-conf.xml and add at least one of your node's public name or IP to the seed section.
  2. 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.
  3. Again, you can check http://localhost:7002 on each machine to make sure all the nodes see each other.
  4. 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.

Next steps:

  1. you may want to edit conf/ 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.
  2. data model explains the Cassandra ColumnFamily data model
  3. 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.)
  • No labels