Skip to content

Building Logstash

aborkar-ibm edited this page Jul 17, 2019 · 88 revisions

Building Logstash

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

  • RHEL (7.4, 7.5, 7.6)
  • SLES (12 SP4, 15)
  • Ubuntu (16.04, 18.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.2.0/build_logstash.sh

# Build Logstash
bash build_logstash.sh   

If the build completes successfully, go to STEP 6. 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.4, 7.5, 7.6)

    With OpenJDK 8:

    sudo yum install -y ant gcc gzip java-1.8.0-openjdk make tar unzip wget zip
    

    With AdoptOpenJDK 8:

    sudo yum install -y ant make gcc gzip tar wget zip
    • Download and install AdoptOpenJDK 8 with HotSpot from here.
  • SLES (12 SP4, 15)

    With OpenJDK 8:

    sudo zypper install -y ant gawk gcc gzip java-1_8_0-openjdk-devel make tar unzip wget zip
    

    With AdoptOpenJDK 8:

    sudo zypper install -y ant gawk gcc gzip make tar unzip wget zip
    • Download and install AdoptOpenJDK 8 with HotSpot from here.
  • Ubuntu (16.04, 18.04)

    With OpenJDK 8:

    sudo apt-get update
    sudo apt-get install -y ant gcc gzip openjdk-8-jdk make tar unzip wget zip

    With AdoptOpenJDK 8:

    sudo apt-get update
    sudo apt-get install -y ant gcc gzip make tar unzip wget zip
    • Download and install AdoptOpenJDK 8 with HotSpot from here.

3) Set Environment Variables

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

4) Install jffi

cd $SOURCE_ROOT
wget https://github.com/jnr/jffi/archive/jffi-1.2.18.tar.gz
tar -xzvf jffi-1.2.18.tar.gz
cd jffi-jffi-1.2.18
ant
export LD_LIBRARY_PATH=$SOURCE_ROOT/jffi-jffi-1.2.18/build/jni/:$LD_LIBRARY_PATH

5) Download and Install Logstash

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

sudo mkdir /usr/share/logstash
sudo tar -xzf logstash-oss-7.2.0.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/

Recreating jruby-complete jar file to include platform.conf

cd /usr/share/logstash/logstash-core/lib/jars
unzip jruby-complete-9.2.7.0.jar -d jruby-complete-9.2.7.0
cd jruby-complete-9.2.7.0/META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/s390x-linux
cp -n types.conf platform.conf
cd /usr/share/logstash/logstash-core/lib/jars/jruby-complete-9.2.7.0
zip -r ../jruby-complete-9.2.7.0.jar *
cd  /usr/share/logstash/
rm -rf /usr/share/logstash/logstash-core/lib/jars/jruby-complete-9.2.7.0

6) Verify

> logstash -V
> logstash 7.2.0

References:

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

Clone this wiki locally