Centos 7 virtualbox elasticsearch installation problem

Hello,
I'm trying to install Elasticsearch but there is a problem

[root@localhost ~]# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-06-13 15:34:55 UTC; 8min ago
Docs: http://www.elastic.co
Process: 843 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
Process: 832 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 843 (code=exited, status=1/FAILURE)

Jun 13 17:34:32 localhost.localdomain systemd[1]: Starting Elasticsearch...
Jun 13 17:34:32 localhost.localdomain systemd[1]: Started Elasticsearch.
Jun 13 15:34:55 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 13 15:34:55 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.
Jun 13 15:34:55 localhost.localdomain systemd[1]: elasticsearch.service failed.

If we look in tmp/hs_err_pid*.log, we can see that the problem came from the memory
[root@localhost ~]# vi /tmp/hs_err_pid*.log
29 files to edit

The system is out of physical RAM or swap space

In 32 bit mode, the process size limit was hit

Possible solutions:

Reduce memory load on the system

Increase physical memory or swap space

Check if swap backing store is full

Use 64 bit Java on a 64 bit OS

Decrease Java heap size (-Xmx/-Xms)

Decrease number of Java threads

Decrease Java thread stack sizes (-Xss)

Set larger code cache with -XX:ReservedCodeCacheSize=

This output file may be truncated or incomplete.

Out of Memory Error (os_linux.cpp:2640), pid=1046, tid=0x00007f7a158b6700

JRE version: (8.0_131-b11) (build )

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.

Possible reasons:

The system is out of physical RAM or swap space

In 32 bit mode, the process size limit was hit

Possible solutions:

Reduce memory load on the system

Increase physical memory or swap space

Check if swap backing store is full

Use 64 bit Java on a 64 bit OS

Decrease Java heap size (-Xmx/-Xms)

Decrease number of Java threads

Decrease Java thread stack sizes (-Xss)

Set larger code cache with -XX:ReservedCodeCacheSize=

This output file may be truncated or incomplete.

Out of Memory Error (os_linux.cpp:2640), pid=1046, tid=0x00007f7a158b6700

JRE version: (8.0_131-b11) (build )

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.

Possible reasons:

The system is out of physical RAM or swap space

In 32 bit mode, the process size limit was hit

Possible solutions:

Reduce memory load on the system

Increase physical memory or swap space

Check if swap backing store is full

Use 64 bit Java on a 64 bit OS

Decrease Java heap size (-Xmx/-Xms)

Decrease number of Java threads

Decrease Java thread stack sizes (-Xss)

Set larger code cache with -XX:ReservedCodeCacheSize=

This output file may be truncated or incomplete.

Out of Memory Error (os_linux.cpp:2640), pid=1046, tid=0x00007f7a158b6700

JRE version: (8.0_131-b11) (build )

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)

Can anyone here can help me ?

The default JVM options for Elasticsearch specify a heap size of 2g. If your virtual machine has less than this (accounting for physical RAM specified for the virtual machine, and swap), then the JVM will fail to be able to commit memory for the heap and thus fail to start. You either need to reduce the specified heap usage, or increase the memory for the virtual machine (ideally the virtual machine will have allocated at least double the configured heap space).

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