Differences between revisions 36 and 37
Revision 36 as of 2016-05-18 14:06:36
Size: 2918
Editor: EricEvans
Comment:
Revision 37 as of 2016-09-23 05:56:55
Size: 4338
Comment: Update allthethings
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Add the following lines to `/etc/apt/sources.list`:
Line 4: Line 5:
deb http://www.apache.org/dist/cassandra/debian 21x main
deb-src http://www.apache.org/dist/cassandra/debian 21x main
deb http://www.apache.org/dist/cassandra/debian 30x main
deb-src http://www.apache.org/dist/cassandra/debian 30x main
Line 8: Line 9:
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''. 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''.
Line 10: Line 11:
=== Adding Repository Keys ===
Line 11: Line 13:
If you run ''apt-get update'' now, you will see an error similar to this: If you run `apt-get update` and see an error similar to this:
Line 16: Line 18:
This simply means you need to add the PUBLIC_KEY. You do that like this: This simply means you need to add a PUBLIC_KEY for a Apache Cassandra deb releases. The Apache Cassandra committer's public keys are available at [[https://www.apache.org/dist/cassandra/KEYS]]
Line 18: Line 20:
To add the [[https://www.apache.org/dist/cassandra/KEYS|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):
Line 19: Line 22:
gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D
gpg --export --armor F758CE318D77295D | sudo apt-key add -
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
Line 23: Line 25:
Starting with the 0.7.5 debian package, you will also need to add public key 2B5C1B00 using the same commands as above: `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
Line 25: Line 33:
{{{
gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00
gpg --export --armor 2B5C1B00 | sudo apt-key add -
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
Line 30: Line 55:
You will also need to add public key 0353B12C using the same commands as above:
Line 32: Line 56:
'''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 [[https://www.apache.org/dist/cassandra/KEYS|KEYS]] on 2016-09-23, so releases after this date may be signed with FE4B2BDA)

Eric Evans:
Line 33: Line 63:
gpg --keyserver pgp.mit.edu --recv-keys 0353B12C
gpg --export --armor 0353B12C | sudo apt-key add -
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xF8358FA2F2833C93
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xF758CE318D77295D
Line 37: Line 67:
(The list of Apache contributors public keys is available at [[https://www.apache.org/dist/cassandra/KEYS]]). Sylvain Lebresne:
{{{
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0x4BD736A82B5C1B00
}}}
Line 39: Line 72:
Then you may install Cassandra by doing: 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 ===
Line 44: Line 87:
sudo apt-get install cassandra-tools # optional utilities
Line 60: Line 104:
Make sure you are building with the Sun JDK, not OpenJDK, and not gcj. You want to see something like this: Make sure you are building with the Oracle JDK, not OpenJDK, and not gcj. You want to see something like this:
Line 63: Line 107:
# 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)
$ 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)
Line 69: Line 113:
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 [[https://issues.apache.org/jira/browse/CASSANDRA-1575|CASSANDRA-1575]].''
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.

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 a 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.

stats

DebianPackaging (last edited 2016-09-23 06:01:28 by MichaelShuler)