Docker VM 上的 Elasticsearch

Docker Elasticsearch on VM

我用 Alpine-3.7 创建了一个虚拟机,我正在尝试用 elasticsearch 启动一个容器。 VM内存情况为:

alpine:~/elastic$ free -m
             total       used       free     shared    buffers     cached
Mem:          7483        242       7241          0         34        128
-/+ buffers/cache:         79       7404
Swap:         4095          0       4095

当我尝试 运行 elasticsearch 时,出现此错误:

elasticsearch    | OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000637299000000, 2555904, 1) failed; error='Operation not permitted' (errno=1)
elasticsearch    | OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007337ad000000, 2555904, 1) failed; error='Operation not permitted' (errno=1)
elasticsearch    | #
elasticsearch    | # There is insufficient memory for the Java Runtime Environment to continue.
elasticsearch    | # Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory.
elasticsearch    | # Can not save log file, dump to screen..
elasticsearch    | #
elasticsearch    | # There is insufficient memory for the Java Runtime Environment to continue.
elasticsearch    | # Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory.
elasticsearch    | # Possible reasons:
elasticsearch    | #   The system is out of physical RAM or swap space
elasticsearch    | #   In 32 bit mode, the process size limit was hit
elasticsearch    | # Possible solutions:
elasticsearch    | #   Reduce memory load on the system
elasticsearch    | #   Increase physical memory or swap space
elasticsearch    | #   Check if swap backing store is full
elasticsearch    | #   Use 64 bit Java on a 64 bit OS
elasticsearch    | #   Decrease Java heap size (-Xmx/-Xms)
elasticsearch    | #   Decrease number of Java threads
elasticsearch    | #   Decrease Java thread stack sizes (-Xss)
elasticsearch    | #   Set larger code cache with -XX:ReservedCodeCacheSize=
elasticsearch    | # This output file may be truncated or incomplete.
elasticsearch    | #
elasticsearch    | #  Out of Memory Error (os_linux.cpp:2651), pid=29, tid=0x00007337c59ab700

我没有复制所有的错误。 谁能帮帮我?

我解决了设置这个内核参数的问题:

kernel.pax.softmode=1

# echo 1 > /proc/sys/pax/softmode

注意:对于 reboots-persistent 配置,将 kernel.pax.softmode=1 添加到 /etc/sysctl.conf

谢谢