Installation in error [Solved]

I want install elasticsearch on my server (Linux RHEL-6Server- with jdk1.8.0_112 but I always the same error.
I try with the latest version of jdk ( but the result is the same.

[elasticsearch@pcyy4aix ~]$ cd /logiciels/elasticsearch-5.3.0/bin
[elasticsearch@pcyy4aix bin]$ ./elasticsearch
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread
Elasticsearch requires at least Java 8 but your Java version from /usr/bin/java does not meet this requirement

[elasticsearch@pcyy4aix bin]$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

In the script, I find

if [ $? -ne 0 ]; then
echo "Elasticsearch requires at least Java 8 but your Java version from $JAVA does not meet this requirement"
exit 1

And I try with the same variables and command line, no mistake

[elasticsearch@pcyy4aixbin]$ JAVA=/usr/bin/java
[elasticsearch@pcyy4aix bin]$ES_CLASSPATH=/logiciels/elasticsearch-5.3.0/lib/elasticsearch-5.3.0.jar:/logiciels/elasticsearch-5.3.0/lib/*
[elasticsearch@pcyy4aix bin]$ "$JAVA" -cp "$ES_CLASSPATH"
[elasticsearch@pcyy4aixbin]$ echo $?

Thank you for your help.

Comes when you dont have sufficient memory , can you tell how much memory you have in system , you can check it via

free -m

If you have less than 4 GB then try changing the heap size in jvm.options from 2G (default) and make it 1G or 512M

Here is what I have:

[elasticsearch@pcyy4aix ~]$ free -m
total used free shared buffers cached
Mem: 15822 2400 13422 12 277 1342
-/+ buffers/cache: 780 15041
Swap: 1055 0 1055

I think I have enough memory

And how to make the change ?

I added

ES_JAVA_OPTS="-Xms8g -Xmx8g" ./bin/elasticsearch

In the script "elasticsearch" but I always have an error:

[elasticsearch@pcyy4aix bin]$ ./elasticsearch
./elasticsearch: fork: retry: Resource temporarily unavailable
./elasticsearch: fork: retry: Resource temporarily unavailable
./elasticsearch: fork: retry: Resource temporarily unavailable
./elasticsearch: fork: retry: Resource temporarily unavailable

I fund the file "jvm.options" in the folder "config".
I have change the parameters "Xms" and "Xmx" with "1g" or "8 g" and nothing.
Always the same error.

I found the problem.
I increase the number of processus of user "elasticsearch" of 2 to 200 to modify the file "/etc/security/limits.conf" and added the line

elasticsearch hard nproc 200

Now, I have a another problem:

[elasticsearch@pcyy4aix bin]$ ./elasticsearch
Exception in thread "main" SettingsException[Failed to load settings from /logiciels/elasticsearch-5.3.0/config/elasticsearch.yml]; nested: AccessDeniedException[/logiciels/elasticsearch-5.3.0/config/elasticsearch.yml];
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
at org.elasticsearch.cli.Command.main(
at org.elasticsearch.bootstrap.Elasticsearch.main(
at org.elasticsearch.bootstrap.Elasticsearch.main(
Caused by: java.nio.file.AccessDeniedException: /logiciels/elasticsearch-5.3.0/config/elasticsearch.yml
at sun.nio.fs.UnixException.translateToIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(
at java.nio.file.Files.newByteChannel(
at java.nio.file.Files.newByteChannel(
at java.nio.file.spi.FileSystemProvider.newInputStream(
at java.nio.file.Files.newInputStream(
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(
... 6 more

I fund this error's origin.
The folder of "elasticsearch" had the owner "root" instead of "elasticsearch".

Now, the process run:

496 7182 1 13 18:03 ? 00:00:19 /usr/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/logiciels/elasticsearch-5.3.0 -cp /logiciels/elasticsearch-5.3.0/lib/elasticsearch-5.3.0.jar:/logiciels/elasticsearch-5.3.0/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/ -d -Edefault.path.logs=/var/log/elasticsearch -Edefault.path.conf=/etc/elasticsearch

But the connection at the URL "http://@IP:9200" don't answer.

Is it normal ?

The test with curl works :smile:

[root@pcyy4aix logiciels]# curl http://localhost:9200/
"name" : "t9LuWpF",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "ILYG0mQRTlqDa7mP5x2DuA",
"version" : {
"number" : "5.3.0",
"build_hash" : "3adb13b",
"build_date" : "2017-03-23T03:31:50.652Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
"tagline" : "You Know, for Search"

Great to hear it works.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.