Skip to content

Building Logstash

linuxonz edited this page Aug 22, 2024 · 76 revisions

Building Logstash

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

  • RHEL (8.8, 8.10, 9.2, 9.4)
  • SLES (12 SP5, 15 SP5, 15 SP6)
  • Ubuntu (20.04, 22.04, 24.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.15.0/build_logstash.sh
# Build Logstash
bash build_logstash.sh [Provide -j (Temurin11|Temurin17|OpenJDK11|OpenJDK17) 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 (8.8, 8.10, 9.2, 9.4)

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

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

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

3) Install Java

  • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)
    • Download and install Eclipse Adoptium Temurin Runtime (Java 11 and 17) from here.
  • With OpenJDK 11
    • RHEL (8.8, 8.10, 9.2, 9.4)
      sudo yum install -y java-11-openjdk-devel
    • SLES (12 SP5, 15 SP5, 15 SP6)
      sudo zypper install -y java-11-openjdk java-11-openjdk-devel
    • Ubuntu (20.04, 22.04, 24.04)
      sudo apt-get install -y openjdk-11-jre openjdk-11-jdk
  • With OpenJDK 17
    • RHEL (8.8, 8.10, 9.2, 9.4)
      sudo yum install -y java-17-openjdk-devel
    • SLES (15 SP5, 15 SP6)
      sudo zypper install -y java-17-openjdk java-17-openjdk-devel
    • Ubuntu (20.04, 22.04, 24.04)
      sudo apt-get install -y openjdk-17-jre openjdk-17-jdk

Note: Eclipse Adoptium Temurin Runtime Version jdk-11.0.24+8, Version jdk-17.0.12+7, OpenJDK 11 and OpenJDK 17 were used for verifying these instructions.

4) Set the environment variables for Java

export LS_JAVA_HOME=/<Path to JDK>/
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.15.0-linux-aarch64.tar.gz
sudo mkdir /usr/share/logstash
sudo tar -xzf logstash-oss-8.15.0-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 LS_JAVA_HOME defined java: <Path to JDK>
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.15.0

References:

Clone this wiki locally