Skip to content

Building Logstash

aborkar-ibm edited this page Dec 22, 2020 · 87 revisions

Building Logstash

The instructions provided below specify the steps to build Logstash 7.10.0 on Linux on IBM Z for following distributions:

  • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
  • SLES 12 SP5
  • Ubuntu (18.04, 20.04)

General Notes:

  • 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 writable directory anywhere you'd like to place it.

1) Build using script

If you want to build Logstash using manual steps, go to STEP 2.

Use the following commands to build Logstash using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Logstash/7.10.0/build_logstash.sh

# Build Logstash
bash build_logstash.sh [Provide -j AdoptJDK11_openj9 to run with AdoptOpenJDK 11 (With OpenJ9)]

If the build completes successfully, go to STEP 8. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

2) Install dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)

    sudo yum install -y ant gcc java-1.8.0-openjdk make tar wget
  • SLES 12 SP5

    sudo zypper install -y ant gawk gcc java-1_8_0-openjdk-devel make tar wget
  • Ubuntu (18.04, 20.04)

    sudo apt-get update
    sudo apt-get install -y gzip make tar wget libjffi-jni
    export LD_LIBRARY_PATH=/usr/lib/s390x-linux-gnu/jni/:$LD_LIBRARY_PATH

3) Set Environment Variables (For RHEL and SLES)

export JAVA_HOME=<Path to Java>
export PATH=$JAVA_HOME/bin:$PATH

4) Install jffi (For RHEL and SLES)

cd $SOURCE_ROOT
wget https://github.com/jnr/jffi/archive/jffi-1.2.23.tar.gz
tar -xzvf jffi-1.2.23.tar.gz
cd jffi-jffi-1.2.23
ant
export LD_LIBRARY_PATH=$SOURCE_ROOT/jffi-jffi-1.2.23/build/jni/:$SOURCE_ROOT/jffi-jffi-1.2.23/build/jni/libffi-s390x-linux/.libs:$LD_LIBRARY_PATH

5) Install Java 11

  • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)

    • With Open JDK:
      sudo yum install -y java-11-openjdk java-11-openjdk-devel
      
    • With AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot)
      • Download and install AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot) from here.
  • SLES 12 SP5

    • With Open JDK:
      sudo zypper install -y java-11-openjdk java-11-openjdk-devel
      
    • With AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot)
      • Download and install AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot) from here.
  • Ubuntu (18.04, 20.04)

    • With Open JDK

      sudo apt-get install -y openjdk-11-jdk
      
    • With AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot)

      • Download and install AdoptOpenJDK (OpenJDK11 with Eclipse OpenJ9 , OpenJDK11 with Hotspot) from here.

Note: At the time of creation of these build instructions, Logstash was verified with AdoptOpenJDK 11 version (build 11.0.8+10).

6) Set the environment variables

export JAVA_HOME=/<Path to JDK 11>/
export PATH=$JAVA_HOME/bin:$PATH

7) Download and Install Logstash

cd $SOURCE_ROOT
wget https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.10.0-linux-aarch64.tar.gz

sudo mkdir /usr/share/logstash
sudo tar -xzf logstash-oss-7.10.0-linux-aarch64.tar.gz -C /usr/share/logstash --strip-components 1
sudo ln -sf /usr/share/logstash/bin/* /usr/bin

sudo groupadd [username]
sudo chown [username]:[username] -R /usr/share/logstash/

8) Verify

> logstash -V
> logstash 7.10.0

References:

https://www.elastic.co/products/logstash

Clone this wiki locally