2016-01-12 31 views
6

を割り当てることができません。私が私の地元のUbuntuマシン以下のガイドにelasticsearchをインストールしようとしています:のUbuntu - elasticsearch - エラー:メモリ

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

、と試しては './elasticsearch' を実行する方法

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 
ここ

あるメモリの統計:

   total  used  free  shared buffers  cached 
Mem:  8113208 4104900 4008308  44244  318076 1926964 
-/+ buffers/cache: 1859860 6253348 
Swap:  7812092   0 7812092 
、次のエラーが発生しましたログから

エラーメッセージ:

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 

はすでにのaptを使用してリポジトリからインストールして、以前のバージョンを試してみましたが、何も働きました。

誰もが何が問題なのか考えていますか?

+0

RAMの問題(「メモリ不足」)があります。可能な解決策を見てください。まず、 'Javaヒープサイズを小さくする(-Xmx/-Xms)'を試してみましょう。 – Val

+0

@Var何も変更されず、同じエラーが再び発生します。使用するメモリが4g残っている場合のメモリの問題人々が同じ問題を抱えていた他のいくつかの問題が見つかりましたが、それらのケースでは、メモリは総メモリの高さとほぼ同じです – Cudoviste

+0

何とか、利用可能なものよりも多くを割り当てようとします。これは役に立ちますか?https://www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-configuration.html#vm-max-map-count – Val

答えて

8

デフォルトのオプションでElasticSearchを開始しようとしているようですが、2Goのスタックサイズを設定しようとしています。もしあなたがその無料のkaboom(サイレント)を持っていなければ。

/etc/elasticsearch/jvm.optionsで見てみると、行変更:ご利用可能なメモリに収まる何かに

-Xms2g 
-Xmx2g 

を。しかし、ElasticSearchは素晴らしい大きなメモリの豚であり、それをすべて望んでいることに注意してください。あなたは2Goの制限の下で有用なシステムを手に入れることはできません。

+1

こんにちは、私は4GBのRAMを持っていると私は 'ElasticSearch'に1GB以上の余裕ができるとは思わない。 1GBのRAMで 'elasticsearch'がうまく動作しませんか?なぜそうでなければ? – sphoenix

1

まず、Elasticsearchはハイブリッドmmapfs/niofsディレクトリを使用します。オペレーティングシステムはmmapカウントを制限します。通常、デフォルト値は65536です。これにより、メモリ不足の例外が発生する可能性があります。 /etc/sysctl.confのでvm.max_map_count設定を更新することにより、永続的に

sysctl -w vm.max_map_count=262144 

をまたは:Linuxでは は、rootとして次のコマンドを実行して、このデフォルトのカーネル値を増やすことができます。また、次のコマンドで変更することができます。

echo 262144 > /proc/sys/vm/max_map_count 

詳細情報については、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.

あなたが考慮すべき第二のものは、JVM最小ヒープサイズと最大ヒープサイズです。マシン上でこの値を/etc/elasticsearch/jvm.optionsに変更することができます。適切な値を選択するには、Elastic set JVM heap size pageに親指の良いルールを見つけることができます。