Skip to content

Building Cassandra

Bryan Chan edited this page Aug 6, 2015 · 9 revisions

The following build instructions have been tested on Linux on z System with IBM Java 1.7

The following are the steps to build Cassandra 2.0.14 from source with IBM Java 1.7. Note: This recipe is specific to IBM Java 1.7 and thus cannot be used with OpenJDK. Please refer to the Cassandra documentation for building with alternative JVM's.

NOTE: When following the steps below please use a standard permission user unless otherwise specified.

Building Cassandra 2.0.14 with IBM Java 1.7

  1. 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 work best with Apache Ant(TM) version 1.9.2. If the version is not available on the system, install the binaries using the command:

     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. The next step is to build Snappy Java as a jar with IBM JDK.

  2. Get the Cassandra source from the Apache mirror. 2.0.14 is the current most stable release.

     wget http://archive.apache.org/dist/cassandra/2.0.14/apache-cassandra-2.0.14-src.tar.gz
    
  3. Extract and apply patch.

     tar -xvf apache-cassandra-2.0.14-src.tar.gz
     cd apache-cassandra-2.0.14-src
    
     # apply the patch.
     wget https://raw.githubusercontent.com/linux-on-ibm-z/docs/master/patches/cassandra-2.0.14-ibm-java.patch
     patch -p1 < cassandra-2.0.14-ibm-java.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
    
  4. Build Cassandra

     ant
    

    The Cassandra jar is available under the bin folder.

  5. Run the unit test.

     cd apache-cassandra-2.0.14-src
     ant test
    
Clone this wiki locally