Unable to install Logstash because it can not find JAVA_HOME
I did not install JAVA because it is included in ELK. Elasticsearch, Kibana and Logstash are on the same server.
Elacticsearh and Kibana works. But how to configure the installation of Logstash ?
I am on Ubuntu 18.04
ubuntu@monitoring-example-com:~$ sudo apt install logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
logstash
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 173 MB of archives.
After this operation, 299 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 logstash all 1:7.1.0-1 [173 MB]
Fetched 173 MB in 16s (11.0 MB/s)
Selecting previously unselected package logstash.
(Reading database ... 166387 files and directories currently installed.)
Preparing to unpack .../logstash_1%3a7.1.0-1_all.deb ...
Unpacking logstash (1:7.1.0-1) ...
Setting up logstash (1:7.1.0-1) ...
could not find java; set JAVA_HOME or ensure java is in PATH
chmod: cannot access '/etc/default/logstash': No such file or directory
dpkg: error processing package logstash (--configure):
installed logstash package post-installation script subprocess returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
That's for Elasticsearch, not for Logstash.
So you either need to tell Logstash to use the bundled one in Elasticsearch - which I am not sure if we support - or install your own.
ubuntu@example-revolutime-com:~$ sudo apt install logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
logstash
1 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
1 not fully installed or removed.
Need to get 173 MB of archives.
After this operation, 142 kB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 logstash all 1:7.1.1-1 [173 MB]
Fetched 173 MB in 15s (11.5 MB/s)
(Reading database ... 182520 files and directories currently installed.)
Preparing to unpack .../logstash_1%3a7.1.1-1_all.deb ...
Unpacking logstash (1:7.1.1-1) over (1:7.1.0-1) ...
Setting up logstash (1:7.1.1-1) ...
could not find java; set JAVA_HOME or ensure java is in PATH
chmod: cannot access '/etc/default/logstash': No such file or directory
dpkg: error processing package logstash (--configure):
installed logstash package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
logstash
E: Sub-process /usr/bin/dpkg returned an error code (1)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.