Installed elastic search kibana and logstash on the same machine now facing a few error

+1 vote

I have installed elastic search, kibana and logstash on the same machine. I haven't done anything other than installing them. I somehow ended up with these error:

ubuntu@ip-172-31-31-152:~$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.7G 2.4G 5.4G 31% /
ubuntu@ip-172-31-31-152:~$ sudo apt-get install logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
logstash is already the newest version (1:6.4.2-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up logstash (1:6.4.2-1) ...
Using provided startup.options file: /etc/logstash/startup.options
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error="Cannot allocate memory" (errno=12)
/usr/share/logstash/bin/system-install: line 88: #: command not found
chmod: cannot access "/etc/default/logstash": No such file or directory
dpkg: error processing package logstash (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
logstash
E: Sub-process /usr/bin/dpkg returned an error code (1)
ubuntu@ip-172-31-31-152:~$
Dec 20, 2018 in Other DevOps Questions by Ali
• 11,360 points
2,340 views

2 answers to this question.

0 votes

The issue which you are facing is because of the Java Version. Could you please let us know the Java Version installed on your System? You can check it using the below command:

java -version
answered Dec 20, 2018 by Alan

Thanks for the response

openjdk version 1.8.0_151
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

The issue which you are facing is because of the Open JDK installed. Please follow the below steps to resolve the issue:

(i) Download the Java using the below command:

wget http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-i586.tar.gz

sudo mkdir /usr/lib/jvm

cd /usr/lib/jvm

sudo tar -xvzf ~/Downloads/jdk-8u151-linux-x64.tar.gz

(ii) Now edit the Environment file using the below command:

vi /etc/environment

(iii) Add the below lines:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.8.0_151/bin:/usr/lib/jvm/jdk1.8.0_151/db/bin:/usr/lib/jvm/jdk1.8.0_151/jre/bin"

J2SDKDIR="/usr/lib/jvm/jdk1.8.0_151"

J2REDIR="/usr/lib/jvm/jdk1.8.0_151/jre"

JAVA_HOME="/usr/lib/jvm/jdk1.8.0_151"

DERBY_HOME="/usr/lib/jvm/jdk1.8.0_151/db"

(c) Save the file and execute the below command:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_151/bin/java" 0 

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_151/bin/javac" 0 

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_151/bin/java 

sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_151/bin/javac

Thanks, that was the issue indeed, solved my problem.
My pleasure.. I've answered the solution so that it can help others.
0 votes

The issue which you are facing is because of the Open JDK installed. Please follow the below steps to resolve the issue:

(i) Download the Java using the below command:

wget http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-i586.tar.gz

sudo mkdir /usr/lib/jvm

cd /usr/lib/jvm

sudo tar -xvzf ~/Downloads/jdk-8u151-linux-x64.tar.gz

(ii) Now edit the Environment file using the below command:

vi /etc/environment

(iii) Add the below lines:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.8.0_151/bin:/usr/lib/jvm/jdk1.8.0_151/db/bin:/usr/lib/jvm/jdk1.8.0_151/jre/bin"

J2SDKDIR="/usr/lib/jvm/jdk1.8.0_151"

J2REDIR="/usr/lib/jvm/jdk1.8.0_151/jre"

JAVA_HOME="/usr/lib/jvm/jdk1.8.0_151"

DERBY_HOME="/usr/lib/jvm/jdk1.8.0_151/db"

(c) Save the file and execute the below command:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_151/bin/java" 0 

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_151/bin/javac" 0 

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_151/bin/java 

sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_151/bin/javac

answered Dec 20, 2018 by Alan

Related Questions In Other DevOps Questions

+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,516 views
+2 votes
1 answer
+1 vote
2 answers

When do we use Chef or Azure SDK to create VM and deploy in automation

The solution to the automated deployment in ...READ MORE

answered Aug 21, 2018 in Other DevOps Questions by Priyaj
• 58,090 points
858 views
+1 vote
1 answer

How do I install Maven on CentOS?

Hey @Nagraj, Follow these steps to install Maven ...READ MORE

answered Feb 19, 2019 in Other DevOps Questions by Nishant
7,402 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP