-
Notifications
You must be signed in to change notification settings - Fork 0
casandraa
The following build instructions have been tested on IBM Java 1.7 on IBM z Systems
The following are the steps to build Cassandra 2.0.14 from source with IBM Java 1.7.
-
Download the requirements
RHEL 7 # use sudo yum remove <package-name> to remove openjdk if installed. sudo yum install java-1.7.1-ibm.s390x, libstdc++.s390x, libstdc++-devel.s390x SLES 12 # use sudo zypper remove <package-name> to remove openjdk if installed. sudo zypper install java-1_7_1-ibm java-1_7_1-ibm-devel java-1_7_1-ibm-jdbc libstdc++-static
The Unit tests for Cassandra 2.0.14 works best with Apache Ant(TM) version 1.9.2. If the version is not available on the system, install the binaries using the comand:
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz tar -xvf apache-ant-1.9.2-bin.tar.gz cd apache-ant-1.9.2 export ANT_HOME=`pwd` cd bin export PATH=$PATH:`pwd`
Cassandra also requires Snappy Java (Story 1114777) so the next step is to build Snappy jar to work with IBM Java.
mkdir snappy_z cd snappy_z wget https://github.com/linux-on-ibm-z/snappy-java/archive/develop-s390x.zip # change $JAVA_HOME to the java-1.7.1-ibm directory, e.g., # example: export JAVA_PATH=/usr/lib64/jvm/java-1.7.1-ibm-1.7.1 export JAVA_PATH=<path> make USE_GIT=1 GIT_REPO_URL=https://github.com/google/snappy.git GIT_SNAPPY_BRANCH=master IBM_JDK_7=1 # the generated jar is in snappy-java/target folder - snappy-java-<version>-SNAPSHOT.jar
-
Get the Cassandra source from the Apache mirror. 2.0.14 is the current most stable release.
wget http://mirror.its.dal.ca/apache/cassandra/2.0.14/apache-cassandra-2.0.14-src.tar.gz
-
Extract and apply patch.
tar -xvf apache-cassandra-2.0.14-src.tar.gz cd apache-cassandra-2.0.14-src
apply the patch. Since the changes have not been contributed to the Apache community, the changes are attached to this recipe. The required patch is in
cassandra-2.0.14.patch
andObjectSizes.java
contains the full source code.patch -p2 < cassandra-2.0.14.patch # replace the original Snappy jar in the source and copy over the IBM compatible jar into the lib folder. rm ./lib/snappy-java-1.0.5.jar cp snappy-java-<version>-SNAPSHOT.jar ./lib
-
Build Cassandra
ant
The Cassandra jar is available under the bin folder.
-
Run the unit test.
cd apache-cassandra-2.0.14-src ant test