Elasticsearch 7.6.1 service won't start in Ubuntu server 18.04

Hi,

Fresh install Ubuntu server 18.04 and I am trying to use Elasticserach, Kibana, Logstash. I used command "apt-get install" so the system will detect/install all dependencies for the software. Also installed Java Openjdk 8 (apparently Elasticsearch needs it).

The installation ran smoothly, but Elasticsearch service won't start (error message + log link below).

Q:
1- By installing Elasticsearch, the apps Kibana and Logstash are already included by default or do I need to install each app separately (that's what I did last time)?
2- Any ideas or advice about this error?

Output error + logs: https://pastebin.com/czMqPD9N

Thanks

From your log;

[2020-03-05T15:34:12,057][ERROR][o.e.b.Bootstrap          ] [server1] Exception
org.elasticsearch.ElasticsearchException: Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].

It's odd that it'd complain though, what's uname -a return?

Elasticsearch is stand alone, you need to install Kibana and Logstash separately.

Hi warkolm,

Just to be sure that nothing else is interfering with Elasticsearch, I installed a new machine, which only has the OS, updates, Java and Elasticsearch.
The steps were:

Unfortunately, the problem persists. Exactly the same error.


user @ server1: ~ $ uname -a
Linux server1 4.15.0-88-generic # 88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU / Linux

Any ideas about what could be causing this issue? Am I missing something like libraries, plugins or setup steps?
Of course, I would prefer to use the last version of Elasticsearch but, should I try a previous version?

I am thinking this may be a Java issue. Per official documentation:

" Elasticsearch is built using Java, and includes a bundled version of OpenJDK from the JDK maintainers (GPLv2+CE) within each distribution. The bundled JVM is the recommended JVM and is located within the jdk directory of the Elasticsearch home directory."

I have been installing "openjdk-8-jdk" or the "default-jdk" previous to install Elasticsearch and that could create some kind of conflict. I will try a fresh installation without installing additional version of Java.

But my questions would be:
1- Does Logstash include a bundled version of [OpenJDK] as well?
2- Would Logstash be able to use the Java included in the Elasticserach installation, if it does not have a bundled version within?
3- Would it be better or recommended to install Oracle/OpenJDK 11 to be used by both Elasticsearch and Logstash instead of the included bundled version of Java?

I just tried a fresh OS install + Elasticsearch + bundled OpenJDK. Issue persist. I am sharing the steps I followed and the outputs.

Outputs and logs: https://pastebin.com/8yVnVxeL

Another fresh OS install, now without installing the HTTPS transport and also using the bundled OpenJDK. There is nothing else installed but the OS and Elastic search. OS and JDK versions were found in the Support Matrix for Elasticsearch. This should be enough for Elasticsearch to function. Issue persist, but error is different (timeout). If there is anything else I can try to help narrowing the issue, please let me now.

  • Install OS Ubuntu Server 18.04.4
  • apt-get update
  • apt-get upgrade
  • reboot
  • (using bundled version of OpenJDK included in the distribution)
  • (NOT installing apt-transport-https this time)
  • wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  • add-apt-repository "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
  • sudo apt-get update
  • apt-get install elasticsearch
  • systemctl enable elasticsearch.service
  • systemctl start elasticsearch.service

Outputs and logs: https://pastebin.com/MWSCprKx

What are the specs for the host? How much heap are you giving to Elasticsearch?

It's a virtual machine running Ubuntu Server 18.04.4 LTS, with 3072 GB of RAM, two virtual processors and 100 GB of HDD assigned to it.

Physical host server has a CPU AMD Phenom(tm) II X4 955 at 3.21 GHz.

Are you able to do a lab test on your end?

I could try the solution suggested and run Elasticsearch without machine learning functionality, but I would like to use this feature.

Even when only Elasticsearch will be running on this PC, is it mandatory to configure variables "Xms1g" and "Xmx1g" in the jvm.options file, or the app will use all available memory if no limit is established?

Hey, You wanna trying running Elasticsearch with Docker to see if you get it up? There are plentiful of working dockerized Elasticsearch to begin with.

Hi @ManuelF.

just try with my steps with Ubuntu-18 as below-

Step01

Before going to download Elasticsearch file we need to install java
Because Elasticsearch uses java for internal process.
And also we need to set home path for java as below command.
Command :-

$sudo apt update && sudo apt install openjdk-8-jre-headless
$export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

java under installation process
image
set java home path-


Step02-for Elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add –

echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list

install Elasticsearch now by using below command

Command :-
sudo apt update && sudo apt install elasticsearch you can select any version here

image

after complete above step-
we can start Elasticsearch as below command.
**Command :-**

sudo systemctl start elasticsearch.service

now we can verify the Elasticsearch running status by using beow command
**Command :-**
sudo systemctl status elasticsearch.service
image
test Elasticsearch as below -
sudo curl -XGET 'localhost:9200/'

Pls do like , if this is helpful to you :slight_smile:

Thanks
HadoopHelp

Hi @rameshkr1994,

Thank you for sharing these steps, which I will be testing shortly and let you know the results.
I already knew that Elasticsearch needs Java to run, but the developers recommends using the bundled Java version included with the Elasticsearch installation. It would be logical to think that this version should already be tested and ensure that it works.
Even so I will try the external installation of Java, as you suggest.

Thanks

Hi @rameshkr1994.

I am sorry to tell you that the app keeps failing with the same error. You can check details here:
https://pastebin.com/hjnV0bmF

Thanks

Hi @ManuelF.

what error you are getting ?

i am not able open your log as you shared .

Thanks
HadoopHelp

[2020-03-11T13:58:13,364][ERROR][o.e.b.Bootstrap ] [server1] Exception

org.elasticsearch.ElasticsearchException: Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].

    at org.elasticsearch.xpack.ml.MachineLearning.createComponents(MachineLearning.java:587) ~[?:?]

    at org.elasticsearch.node.Node.lambda$new$9(Node.java:456) ~[elasticsearch-7.6.1.jar:7.6.1]

    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) ~[?:?]

    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1621) ~[?:?]

    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]

    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]

    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]

    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]

    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]

    at org.elasticsearch.node.Node.<init>(Node.java:459) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.node.Node.<init>(Node.java:257) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) [elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) [elasticsearch-cli-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.6.1.jar:7.6.1]

[2020-03-11T13:58:13,433][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [server1] uncaught exception in thread [main]

org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].]

    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.6.1.jar:7.6.1]

    at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.6.1.jar:7.6.1]

    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.6.1.jar:7.6.1]

Caused by: org.elasticsearch.ElasticsearchException: Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].

Hi @ManuelF.

remove completely your previous version and also check for this -

as log i seen ... don't go with log ...i suffered a lot the same when i started first time of elastic installation .

set [xpack.ml.enabled: false].

I suggest you please clean all elastic related file then try to install.

Thanks
HadoopHelp

@rameshkr1994,

That's what I am about to try, but I would like to be able to use machine learning functionality, if possible...

A soon I disabled the machine learning functionality in elasticsearch.yml, the service was able to start. Even without defining anything else like node name, role, IP. Everything has default settings.

So, machine learning is not compatible with Ubuntu Server 18.04.4 LTS? Or is it perhaps the CPU AMD Phenom(tm) II X4 955 at 3.21 GHz?

Any idea or advice @warkolm?

Hi @ManuelF.

you are going good.

Please go through this link-

ml-elk
elastic matrix for ML

sorry i never used ml and don't have any further idea for that.

Thanks
HadoopHelp