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 19, 2018 in Other DevOps Questions by Ali
• 10,440 points
511 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 19, 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 19, 2018 by Alan

Related Questions In Other DevOps Questions

0 votes
1 answer

How to get issues count based on rules in a sonar project?

There are API docs in the footer ...READ MORE

answered May 4, 2018 in Other DevOps Questions by DareDev
• 6,810 points
507 views
0 votes
1 answer

Setting up CICD on a local server

As to how to integrate git repo ...READ MORE

answered May 31, 2018 in Other DevOps Questions by ajs3033
• 7,280 points

edited May 31, 2018 by ajs3033 36 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
261 views
0 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
• 57,300 points
162 views
0 votes
1 answer

How do I install Maven on CentOS?

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

answered Feb 19 in Other DevOps Questions by Nishant
318 views