Skip to content

Building Logstash

aborkar-ibm edited this page Sep 14, 2022 · 85 revisions

Building Logstash

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

  • RHEL (7.8, 7.9, 8.4, 8.6)
  • SLES (12 SP5, 15 SP3, 15 SP4)
  • Ubuntu (18.04, 20.04, 22.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/8.3.3/build_logstash.sh

# Build Logstash
bash build_logstash.sh [Provide -j (Temurin11|Semeru11|OpenJDK11) option for building with specific java]

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.4, 8.6)

    sudo yum install -y curl ant gcc make tar wget
  • SLES (12 SP5, 15 SP3, 15 SP4)

    sudo zypper install -y curl ant gawk gcc make tar wget
  • Ubuntu (18.04, 20.04, 22.04)

    sudo apt-get update
    sudo apt-get install -y gzip make tar curl wget

3) Install Java 11

  • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9).

    • Download and install IBM Semeru Runtime (Java 11) from here.
  • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

    • Download and install Eclipse Adoptium Temurin Runtime (Java 11) from here.
  • With OpenJDK 11

    • RHEL (7.8, 7.9, 8.4, 8.6)
      sudo yum install -y java-11-openjdk-devel
    • SLES (12 SP5, 15 SP3, 15 SP4)
      sudo zypper install -y java-11-openjdk java-11-openjdk-devel
    • Ubuntu (18.04, 20.04, 22.04)
      sudo apt-get install -y openjdk-11-jdk

Note: Version jdk-11.0.15+10 was used for Eclipse Adoptium Temurin Runtime & IBM Semeru Runtime while verifying these instructions.

4) Set the environment variables for Java 11

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

5) Download and Install Logstash

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

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

sudo groupadd elastic
sudo chown "$(whoami)":elastic -R /usr/share/logstash/

6) Verify

logstash -V

Should output:

Using JAVA_HOME defined java: <Path to JDK 11>
WARNING: Logstash comes bundled with the recommended JDK(BUNDLED_JDK_VERSION), but is overridden by the version defined in LS_JAVA_HOME. Consider clearing LS_JAVA_HOME to use the bundled JDK.
logstash 8.3.3

References:

Clone this wiki locally