Official Package To Install On Debian(tm) (not a product of Debian(tm))
Alternatively, you can install directly from the ASF repositories:
deb http://www.apache.org/dist/cassandra/debian 21x main deb-src http://www.apache.org/dist/cassandra/debian 21x main
You will want to replace 21x by the series you want to use: 20x for the 2.0.x series, 12x for the 1.2.x series, etc... You will not automatically get major version updates unless you change the series, but that is a feature.
If you run apt-get update now, you will see an error similar to this:
GPG error: http://www.apache.org unstable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F758CE318D77295D
This simply means you need to add the PUBLIC_KEY. You do that like this:
gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D gpg --export --armor F758CE318D77295D | sudo apt-key add -
Starting with the 0.7.5 debian package, you will also need to add public key 2B5C1B00 using the same commands as above:
gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00 gpg --export --armor 2B5C1B00 | sudo apt-key add -
You will also need to add public key 0353B12C using the same commands as above:
gpg --keyserver pgp.mit.edu --recv-keys 0353B12C gpg --export --armor 0353B12C | sudo apt-key add -
(The list of Apache contributors public keys is available at https://www.apache.org/dist/cassandra/KEYS).
Then you may install Cassandra by doing:
sudo apt-get update sudo apt-get install cassandra
Some things to be aware of:
- The configuration files are located in /etc/cassandra
- Start-up options (heap size, etc) can be configured in /etc/default/cassandra
Building Packages on Debian
Once all the build dependencies are set up, all you need to do is run
dpkg-buildpackage -uc -us
Make sure you are building with the Sun JDK, not OpenJDK, and not gcj. You want to see something like this:
# java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
By default, installing the Cassandra Debian package or its build dependencies will pull in OpenJDK. For runtime purposes this will work fine, but due to an issue with the packaging of OpenJDK in Lenny (see http://bugs.debian.org/501487), building the package from source will fail. If you need to (re)build the package on Lenny, install sun-java6-jdk before-hand (sun-java6-jdk provides java6-sdk which satisfies the dependency), or use the alternatives system to change the default compiler afterward.
sudo update-alternatives --config javac
Note: See also CASSANDRA-1575.