#java #elasticsearch #centos
#java #elasticsearch #centos
Вопрос:
Установил elasticsearch версии 5.5 в centos и выполнил следующую команду для запуска службы.
sudo service elasticsearch start
Получаю следующую ошибку при выполнении приведенной выше команды.
Starting elasticsearch: OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid15359.log
Подскажите мне, как это исправить.
Ответ №1:
Elasticsearch запускается с 2 ГБ оперативной памяти по умолчанию в версиях 5.X .
Предполагая, что вы используете виртуальную машину, кажется, что у вашей виртуальной машины меньше свободной памяти, чем 2 ГБ. Попробуйте предоставить вашей виртуальной машине больше памяти или измените настройки JVM Elasticsearch в /etc/elasticsearch/jvm.options
(например, set -Xms512m -Xmx512m
).