I just installed logstash 7.1.0 from an RPM with sudo yum install logstash.7.1.0.rpm
system has 32 GB RAM.
When im trying to run the service as
[root@elk02 ~]# sudo systemctl start logstash
Failed to start logstash.service: Unit not found.
[root@elk02 ~]# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
[root@elk02 ~]# sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd
could not find java; set JAVA_HOME or ensure java is in PATH
[root@elk02 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export JAVA_HOME=/opt/jdk1.8.0_231
export JRE_HOME=/opt/jdk1.8.0_231/jre
PATH=$PATH:$JAVA_HOME/bin:$HOME/bin
export PATH
Why am i getting the above two errors? How do i fix this?