2016-01-12 17 views
6

Sto cercando di installare elasticsearch sulla mia macchina Ubuntu seguente guida locale:Ubuntu - elasticsearch - Errore: Impossibile allocare memoria

https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html

, e quando tenta di eseguire './elasticsearch' , ha ottenuto seguente errore:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: <br> 

os::commit_memory(0x00007f0e50cc0000, 64075595776, 0) failed; <br> 

error='Cannot allocate memory' (errno=12) <br> 

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

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

Ecco le statistiche di memoria:

   total  used  free  shared buffers  cached 
Mem:  8113208 4104900 4008308  44244  318076 1926964 
-/+ buffers/cache: 1859860 6253348 
Swap:  7812092   0 7812092 

Messaggio di errore da tronchi:

There is insufficient memory for the Java Runtime Environment to continue. 
# Native memory allocation (mmap) failed to map 64075595776 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:2627), pid=13021, tid=139764129740544 
# 
# JRE version: (8.0_66-b17) (build) 
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64) 
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again 

Già provato versione precedente, l'installazione da repository con apt, niente ha funzionato.

Qualcuno ha idea di quale potrebbe essere il problema?

+0

È chiaramente presente un problema di RAM (ad esempio "Errore di memoria esaurito"). Vedi le possibili soluzioni: proverei 'Diminuisci la dimensione dell'heap Java (-Xmx/-Xms)' prima. – Val

+0

@Var non è cambiato nulla, lo stesso errore di nuovo. Come la memoria è un problema quando rimane 4g da usare. Trovato pochi altri problemi in cui le persone hanno avuto lo stesso problema, ma nel loro caso la memoria utilizzata è alta quasi come la memoria totale – Cudoviste

+0

In qualche modo, cerca di allocare più di quello che è disponibile. Questo aiuto? Https: //www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-configuration.html#vm-max-map-count – Val

risposta

8

Sembra che tu stia cercando di avviare ElasticSearch con le opzioni predefinite, che tentano di impostare una dimensione di stack di 2Go. Se non hai quel libero ... kaboom (silenziosamente).

hanno un aspetto per /etc/elasticsearch/jvm.options e modificare le linee:

-Xms2g 
-Xmx2g 

a qualcosa che si inserisce nella vostra memoria a disposizione. Ma tieni presente che ElasticSearch è un grande e grosso ricordo e vuole tutto. Potresti non avere un sistema utile sotto il limite 2Go.

+1

Ciao, ho 4 GB di RAM e non credo di potermi permettere più di 1 GB per 'ElasticSearch'. La 'elasticsearch' non funzionerà bene con una ram da 1 GB? Se no, perché così? – sphoenix

1

Prima di tutto, Elasticsearch utilizza una directory ibrida mmapfs/niofs. Il sistema operativo limita i conteggi di mmap, in genere il valore predefinito è 65536. Potrebbe verificarsi eccezioni di memoria esaurita. Su Linux, è possibile aumentare questo valore kernel predefinito eseguendo il seguente comando come root:

sysctl -w vm.max_map_count=262144 

o permanente, aggiornando l'impostazione vm.max_map_count in /etc/sysctl.conf. È inoltre possibile cambiare con il seguente comando:

echo 262144 > /proc/sys/vm/max_map_count 

Per ulteriori informazioni, si prega di controllare Linux kernel documentation:

max_map_count: This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap and mprotect, and also when loading shared libraries. While most applications need less than a thousand maps, certain programs, particularly malloc debuggers, may consume lots of them, e.g., up to one or two maps per allocation. The default value is 65536.

La seconda cosa che si dovrebbe prendere in considerazione è JVM dimensione minima di heap e dimensione heap massima. È possibile modificare questi valori sulla macchina in /etc/elasticsearch/jvm.options. Per scegliere i valori adatti, è possibile trovare buone regole generali su Elastic set JVM heap size page.

Problemi correlati