How to install Java / Logstash on client side
Installation instructions for Java/Logstash
The following are the steps to install Java and LogStash on various Operating systems.

1) CentOS - v6/7

a) Install Java by downloading the software and
1
>>> sudo wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
2
>>> sudo rpm -Uvh java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
Copied!
b) Check installed Java version
1
>>> java -version
Copied!
c) Install Logstash-7.1.1
1
>>> curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.rpm
2
>>> sudo rpm -ivh logstash-oss-7.1.1.rpm
Copied!
d) Start and Stop Logstash services, use the following commands
1
>>> sudo service logstash start/stop/restart (for CentOS-6)
2
>>> sudo systemctl start/stop/restart logstash (for CentOS-7)
3
You can enable autostart of Logstash services when system reboots using the following command
4
>>> sudo service logstash enable (or)
5
>>> sudo systemctl enable logstash
Copied!

2) RHEL OS 6 / 7

a) Install Java
1
>>> sudo wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
2
>>> sudo rpm -ivh java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
Copied!
b) Check Java Version
1
>>> java -version
Copied!
c) Install LogStash-7.1.1
1
>>> curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.rpm
2
>>> sudo rpm -ivh logstash-oss-7.1.1.rpm
Copied!
d) To stop and Stop Logstash services, use the following commands
1
>>> sudo service logstash start/stop/restart (for RHEL-6)
2
>>> sudo systemctl start/stop/restart logstash (for RHEL-7)
Copied!
e) To auto start logstash services when system reboot follow the below commands.
1
>>> sudo service logstash enable (or) sudo systemctl enable logstash
2
>>> sudo chkconfig --add logstash --level on
Copied!
3) Ubuntu 16.04/18.04 OS:
a) Install Java
1
>>> sudo add-apt-repository ppa:linuxuprising/java
2
>>> sudo apt update
3
>>> sudo apt install openjdk-11-jre-headless
4
5
If above procedure fails, follow the following:
6
>>> sudo curl -O https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
7
>>> sudo tar zxvf openjdk-11.0.2_linux-x64_bin.tar.gz
8
>>> sudo mv jdk-11* /usr/local/
9
>>> sudo vim /etc/profile.d/jdk.sh add below two lines and save the file
10
export JAVA_HOME=/usr/local/jdk-11.0.2
11
export PATH=$PATH:$JAVA_HOME/bin
12
13
>>> source /etc/profile
Copied!
b) Check Java Version
1
>>> java -version
Copied!
c) Install Logstash-7.1.1
1
>>> sudo curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.deb
2
>>> sudo dpkg -i logstash-7.1.1.deb
3
>>> sudo service logstash start/stop
4
Copied!
d) To auto start logstash services when system reboot, enter the following commands
1
>>> sudo service logstash enable (or) sudo systemctl enable logstash
2
>>> sudo chkconfig --add logstash --level on
3
Copied!

3) Oracle Enterprise Linux (OEL 6 / OEL 7)

a) Install Java
1
>>> sudo wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
2
>>> sudo rpm -ivh java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
3
Copied!
b) Check Java Version
1
>>> java -version
Copied!
c) Install LogStash-7.1.1
1
>>> curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.rpm
2
>>> sudo rpm -ivh logstash-oss-7.1.1.rpm
3
>>> sudo initctl start logstash
4
>>> sudo initctl stop logstash
5
Copied!
d) To autostart logstash service when system reboots, enter the following commands
1
>>> sudo service logstash enable (or) sudo systemctl enable logstash
2
>>> sudo chkconfig --add logstash --level on
3
Copied!

4) Debian Linux v8/v9

a) Install Java
1
>>> sudo apt update
2
>>> sudo apt install openjdk-11-jdk
3
Copied!
Note: If the above step failed, download java deb package by following the link below
https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html Copy the package to the server and execute below command
1
>>> sudo dpkg -i jdk-11.0.2_linux-x64_bin.deb
Copied!
b) Check Java Version
1
>>> java --version
Copied!
c) Install Logstash-7.1.1
1
>>> sudo curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.deb
2
>>> sudo dpkg -i logstash-7.1.1.deb
3
>>> sudo service logstash start/stop/restart
Copied!
d) To auto start logstash when system reboots, enter the following commands
1
>>> sudo service logstash enable (or) sudo systemctl enable logstash
2
>>> sudo chkconfig --add logstash --level on
Copied!

5) SLES OS

a) Install Java
1
>>> wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
2
>>> sudo rpm -ivh java-11-openjdk-11.0.4.11-1.el7_7.x86_64.rpm
3
Copied!
b) Check Java version
1
>>> java --version
Copied!
c) Install Logstash
1
>>> curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.rpm
2
>>> sudo rpm -ivh logstash-oss-7.1.1.rpm
3
>>> sudo service logstash start/stop/restart
Copied!
d) To auto start logstash when system reboots follow below commands
1
>>> sudo service logstash enable (or) sudo systemctl enable logstash
2
>>> sudo chkconfig --add logstash --level on
3
Copied!
Last modified 1yr ago
Copy link