Official Package To Install On Debian(tm) (not a product of Debian(tm))
Add the following lines to /etc/apt/sources.list
:
deb http://www.apache.org/dist/cassandra/debian 30x main deb-src http://www.apache.org/dist/cassandra/debian 30x main
You will want to replace 30x
by the series you want to use: 22x
for the 2.2.x series, 21x
for the 2.1.x series, etc... You will not automatically get major version updates unless you change the series, but that is a feature.
Adding Repository Keys
If you run apt-get update
and 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 a PUBLIC_KEY for Apache Cassandra deb releases. The Apache Cassandra committer's public keys are available at https://www.apache.org/dist/cassandra/KEYS
To add the KEYS file to apt in one command (may be repeated on existing installs, if you see an error similar to above, and the new Release Manager keys will be fetched):
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-key list
should show the following keys added, along with the base OS keys:
pub 1024D/F2833C93 2004-01-18 uid Eric Evans <eevans@sym-link.com> uid Eric Evans <eevans@debian.org> uid Eric Evans <eevans@opennms.org> sub 2048g/98CB5BA4 2004-01-18 pub 4096R/8D77295D 2009-07-12 uid Eric Evans <eevans@sym-link.com> uid Eric Evans <eevans@apache.org> uid Eric Evans <eevans@debian.org> uid Eric Evans <eevans@opennms.com> uid Eric Evans <eevans@opennms.org> sub 4096R/C47D63C0 2009-07-12 pub 2048R/2B5C1B00 2011-04-13 uid Sylvain Lebresne (pcmanus) <sylvain@datastax.com> sub 2048R/9CB2AA80 2011-04-13 pub 4096R/0353B12C 2014-09-05 uid T Jake Luciani <jake@apache.org> sub 4096R/D35F8215 2014-09-05 pub 4096R/FE4B2BDA 2009-07-15 uid Michael Shuler <michael@pbandjelly.org> uid Michael Shuler <mshuler@gmail.com> sub 4096R/25A883ED 2009-07-15
Alternative Key Fetching
If you wish to manually add an individual committer's key, apt-key
can fetch from a keyserver, as follows, using the long key ID:
(Michael Shuler's key was added to KEYS on 2016-09-23, so releases after this date may be signed with FE4B2BDA)
Eric Evans:
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xF8358FA2F2833C93 sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xF758CE318D77295D
Sylvain Lebresne:
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0x4BD736A82B5C1B00
Jake Luciani:
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0x749D6EEC0353B12C
Michael Shuler:
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xA278B781FE4B2BDA
Install Apache Cassandra
sudo apt-get update sudo apt-get install cassandra sudo apt-get install cassandra-tools # optional utilities
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
Troubleshooting:
Make sure you are building with the Oracle JDK, not OpenJDK, and not gcj. You want to see something like this:
$ java -version java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
By default, installing the Cassandra Debian package or its build dependencies will pull in OpenJDK. For runtime purposes this will work fine, but you may wish to install Oracle JRE, which is outside the scope of this document.