Skip to content

Building Logstash

linuxonz edited this page Mar 28, 2024 · 72 revisions

Building Logstash

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

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
  • SLES (12 SP5, 15 SP5)
  • Ubuntu (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.13.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 (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)

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

    sudo zypper install -y curl ant gawk gcc make tar wget
  • Ubuntu (20.04, 22.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 (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
      sudo yum install -y java-11-openjdk-devel
    • SLES (12 SP5, 15 SP5)
      sudo zypper install -y java-11-openjdk java-11-openjdk-devel
    • Ubuntu (20.04, 22.04)
      sudo apt-get install -y openjdk-11-jre openjdk-11-jdk
  • With OpenJDK 17
    • RHEL (8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
      sudo yum install -y java-17-openjdk-devel
    • SLES 15 SP5
      sudo zypper install -y java-17-openjdk java-17-openjdk-devel
    • Ubuntu (20.04, 22.04)
      sudo apt-get install -y openjdk-17-jre openjdk-17-jdk

Note: Eclipse Adoptium Temurin Runtime Version jdk-17.0.9+9, Version jdk-11.0.21+9, 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.13.0-linux-aarch64.tar.gz
sudo mkdir /usr/share/logstash
sudo tar -xzf logstash-oss-8.13.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.13.0

References:

Clone this wiki locally