CAssandra - sinherle/Recipes GitHub Wiki
Apache Cassandra is a scalable and fault-tolerant distributed NoSQL database with support for column indexes and denormalized collections. The stable release of Cassandra 2.2.3 has been built and tested on Linux on z Systems. The following instructions can be used for RHEL 7, SLES 12 and Ubuntu 16.04.
General Notes: i) When following the steps below please use a standard permission user unless otherwise specified.
-
A directory
/<source_root>/
will be referred to in these instructions, this is a temporary writeable directory anywhere you’d like to place it.
The following build instructions have been tested with Apache Cassandra 2.2.3 on Linux on Z Systems with Java OpenJDK.
-
RHEL 7:
sudo yum install -y git which java-1.8.0-openjdk-devel.s390x gcc-c++ make automake autoconf libtool libstdc++-static tar wget patch words libXt-devel libX11-devel
-
SLES12:
sudo zypper install -y java-1_7_0-openjdk-devel git which gcc-c++ make automake autoconf libtool libstdc++-devel tar wget patch words libXt-devel libX11-devel unzip xorg-x11-proto-devel xorg-x11-devel alsa-devel cups-devel
-
Ubuntu 16.04:
sudo apt-get install git tar g++ make automake autoconf libtool wget patch libx11-dev libxt-dev openjdk-8-jre openjdk-8-jdk pkg-config texinfo
unset JAVA_TOOL_OPTIONS
export LANG="en_US.UTF-8"
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
```
### Step 3: Install Ant:
pwd
cd bin
export PATH=$PATH:`pwd`
### Step 4: Install the latest version of Snappy-Java:
```
cd /<source_root>/
git clone https://github.com/xerial/snappy-java.git
cd snappy-java
git checkout develop
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk (Only for RHEL7)
export JAVA_HOME=/usr/lib64/jvm/java-1.7.0 (Only for SLES12)
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-s390x (Only for Ubuntu 16.04)
make IBM_JDK_7=1 USE_GIT=1 GIT_SNAPPY_BRANCH=master GIT_REPO_URL=https://github.com/google/snappy.git
```
### Step 5: Build and install Apache Cassandra 2.2.3:
* Replace the original Snappy-Java jar file in the lib folder with installed Snappy-Java:
* Build Apache Cassandra:
_*Note:* The Apache Cassandra jar file is available under the bin folder. Please ignore libraryLoadTest error in case of jna build for SLES12, Copy generated jar to respected folder and run the test case._
* Build jna:
### Step 6: (Optional) Set IBM java at run time:
_*Note:*_
_Use below commands to install IBM Java 1.7 and set it to Java Runtime Environment. Test case results shown in step 7 are executed using openjdk , results may vary by using IBM java_.
* RHEL 7:
* SLES 12:
### Step 7: Run the unit tests:
Run the Cassandra test suite
_**Note:**_
_Run below steps to avoid test case failure in similar situation described below. Ignore `LegacySSTableTest` failure as it is not related to system Z, also ScrubTest failure is fixed in Apache Cassandra 2.2.6,3.0 versions_.
* Replace time out value in build.xml file as shown below to avoid timeout error for multiple test cases.
* To avoid timeout error for IndexSummaryManagerTest replace timeout value as shown below.
Old Value: @Test(timeout = 10000) New Value: @Test(timeout = 30000)e.g. ant test -Dtest.name=LeveledCompactionStrategyTest* Try to run failed test case individually using below command.
wget https://issues.apache.org/jira/secure/attachment/12783543/11054-3.0.patch patch -p1 < 11054-3.0.patch* Apply below patch in case of TimeTypeTest and CompressorTest failed.
wget https://issues.apache.org/jira/secure/attachment/12789190/11214-cassandra-3.0.txt patch -p1 < 11214-cassandra-3.0.txt* Apply below patch in case of NativeCellTest failed.
key_cache_size_in_mb: 12* In case of KeyCacheCqlTest failed due to key_cache size and memory issue, follow below steps add below content in `/<source_root>/cassandra/test/conf/cassandra.yaml` file.