From fe45381c5340daf322a6bf98ffa9cf8ac509edb1 Mon Sep 17 00:00:00 2001 From: Carl Perry Date: Wed, 16 Aug 2017 03:18:17 +0000 Subject: [PATCH] Update ubuntu cassandra to supported repo and version The datastax cassandra repository is publicly flagged as abandoned, and java 7 is no longer available in modern releases of Ubuntu. This moves the cassandra repo from the unsupported datastax repo to the official Apache repo. This also updates to use Java 8 since 7 is no longer supported. Both the cassandra release to be used and the Java used by this element can be changed by setting the environment variables CASSANDRA_RELEASE and CASSANDRA_JAVA accordingly. Notes in the elements install script. Change-Id: I3afc56c6c1a5443c6b71bab8f47222100584833a --- .../ubuntu-cassandra/install.d/10-cassandra | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/integration/scripts/files/elements/ubuntu-cassandra/install.d/10-cassandra b/integration/scripts/files/elements/ubuntu-cassandra/install.d/10-cassandra index 54e34d68cd..14a6e900ca 100755 --- a/integration/scripts/files/elements/ubuntu-cassandra/install.d/10-cassandra +++ b/integration/scripts/files/elements/ubuntu-cassandra/install.d/10-cassandra @@ -3,17 +3,25 @@ set -ex set -o xtrace +# Set CASSANDRA_JAVA to override which release of Java to use, defaults to 8 +if [ ! -z "$CASSANDRA_JAVA" ]; then CASSANDRA_JAVA=8; fi + +# Set CASSANDRA_RELEASE to override which casandra release to use, defaults to 311x +# For current releases supported, see http://cassandra.apache.org/download/ or +# http://dl.bintray.com/apache/cassandra/dists/ +if [ ! -z "$CASSANDRA_RELEASE" ]; then CASSANDRA_RELEASE=311x; fi + export DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated install -qy curl -echo "deb http://debian.datastax.com/community stable main" >> /etc/apt/sources.list.d/cassandra.sources.list -curl -L http://debian.datastax.com/debian/repo_key | apt-key add - +echo "deb http://www.apache.org/dist/cassandra/debian ${CASSANDRA_RELEASE} main" >> /etc/apt/sources.list.d/cassandra.sources.list +curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - apt-get update -apt-get --allow-unauthenticated install -qy openjdk-7-jdk expect python-dev +apt-get --allow-unauthenticated install -qy openjdk-${CASSANDRA_JAVA}-jdk expect python-dev apt-get --allow-unauthenticated install -qy libxml2-dev ntp mc apt-get --allow-unauthenticated install -qy libxslt1-dev python-pexpect apt-get --allow-unauthenticated install -qy python-migrate build-essential -apt-get --allow-unauthenticated install dsc21=2.1.* cassandra=2.1.* -qy +apt-get --allow-unauthenticated install -qy cassandra # The Python Driver 2.0 for Apache Cassandra. pip2 install cassandra-driver