2016-01-12 6 views
6

मैं अपने स्थानीय उबंटू मशीन निम्नलिखित गाइड पर elasticsearch स्थापित करने के लिए कोशिश कर रहा हूँ:उबंटू - 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 

पहले से ही, पिछले संस्करण की कोशिश की उपयुक्त का उपयोग कर खजाने से स्थापित करने, कुछ भी काम किया।

किसी को भी पता है कि समस्या क्या हो सकती है?

+0

आपके पास स्पष्ट रूप से एक रैम समस्या है (यानी 'स्मृति त्रुटि से बाहर')। संभावित समाधान देखें: मैं 'जावा हीप आकार (-Xmx/-Xms)' पहले घटाएं। – Val

+0

@ वार कुछ भी नहीं बदला, एक ही त्रुटि फिर से। उपयोग करने के लिए 4 जी शेष होने पर स्मृति कितनी समस्या है। कुछ अन्य समस्याएं मिलीं जहां लोगों को एक ही समस्या थी, लेकिन उनके मामले में स्मृति लगभग कुल स्मृति – Cudoviste

+0

के रूप में उच्च है, यह किसी भी तरह से उपलब्ध होने से अधिक आवंटित करने का प्रयास करता है। क्या यह मदद करता है? Https: //www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-configuration.html#vm-max-map-count – Val

उत्तर

8

ऐसा लगता है कि आप डिफ़ॉल्ट विकल्प के साथ ElasticSearch प्रारंभ करने का प्रयास कर रहे हैं, जो 2Go का स्टैक आकार सेट करने का प्रयास करता है। यदि आपके पास यह मुफ़्त नहीं है ... कबाब (चुपचाप)।

/etc/elasticsearch/jvm.options में एक नज़र और लाइनों को संशोधित:

-Xms2g 
-Xmx2g 
कुछ है कि आपके उपलब्ध स्मृति में फिट होगा करने के लिए

। लेकिन ध्यान रखें कि लोचदार खोज एक बड़ी बड़ी याददाश्त है और यह सब चाहता है। आपको 2 जीओ सीमा के तहत एक उपयोगी प्रणाली नहीं मिल सकती है।

+1

हाय, मेरे पास 4 जीबी रैम है और मुझे नहीं लगता कि मैं 1 जीबी से अधिक 'लोचदार खोज' पर खर्च कर सकता हूं। 1 जीबी रैम में 'लोचदार खोज' अच्छा प्रदर्शन नहीं करेगा? यदि ऐसा क्यों नहीं है? – sphoenix

1

सबसे पहले, Elasticsearch एक संकर mmapfs/niofs निर्देशिका का उपयोग करता है। ऑपरेटिंग सिस्टम mmap counts पर सीमित है, आमतौर पर डिफ़ॉल्ट मान 65536 है। इसके परिणामस्वरूप आउट-ऑफ-मेमोरी अपवाद हो सकते हैं। स्थायी रूप से /etc/sysctl.conf में vm.max_map_count सेटिंग को अपडेट करके

sysctl -w vm.max_map_count=262144 

या,: लिनक्स पर, आप यह डिफ़ॉल्ट कर्नेल मूल्य रूट के रूप में निम्न आदेश चलाकर बढ़ा सकते हैं। तुम भी निम्न आदेश से बदल सकते हैं:

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 पर अंगूठे के अच्छे नियम पा सकते हैं।

संबंधित मुद्दे