运行 sudo /etc/init.d/elasticsearch start 返回 [ ok ] Starting elasticsearch (via systemctl): elasticsearch.service.
但是运行 netstat -antu 没有端口 9200 的进程
运行 sudo /usr/share/elasticsearch/bin/elasticsearch
返回
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 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 986513408 bytes for committing reserved memory.
An error report file with more information is saved as:
/home/van/hs_err_pid20963.log
在官网的https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
看见可以在/etc/elasticsearch/jvm.options 配置 -Xmx2g - Xmx2g 来指定内存,可是阿里云乞丐版内存就 1G
所以我设定成 -Xmx256m - Xmx256m
然后在运行就 Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException:
/usr/share/elasticsearch/config
所以貌似-Xmx 后面的单位只能是 g
不知道该怎么解决了 很难受