<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>zaqmjuop (Zbc)</title>
    <link>https://ruby-china.org/zaqmjuop</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>如何在 1G 内存的阿里云上运行 elasticsearch</title>
      <description>&lt;p&gt;运行 sudo /etc/init.d/elasticsearch start 返回 [ ok ] Starting elasticsearch (via systemctl): elasticsearch.service.
&lt;br&gt;但是运行 netstat -antu 没有端口 9200 的进程
&lt;br&gt;运行 sudo /usr/share/elasticsearch/bin/elasticsearch
&lt;br&gt;返回
&lt;br&gt;OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; 
&lt;br&gt;error='Cannot allocate memory' (errno=12)
 &lt;br&gt;There is insufficient memory for the Java Runtime Environment to continue.
&lt;br&gt; Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
 &lt;br&gt;An error report file with more information is saved as:
&lt;br&gt; /home/van/hs_err_pid20963.log
&lt;br&gt;在官网的&lt;a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html" rel="nofollow" target="_blank"&gt;https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html&lt;/a&gt;
&lt;br&gt;看见可以在/etc/elasticsearch/jvm.options 配置 -Xmx2g - Xmx2g 来指定内存，可是阿里云乞丐版内存就 1G
&lt;br&gt;所以我设定成 -Xmx256m - Xmx256m
&lt;br&gt;然后在运行就 Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException: &lt;br&gt;/usr/share/elasticsearch/config
&lt;br&gt;所以貌似-Xmx 后面的单位只能是 g
&lt;br&gt;不知道该怎么解决了&lt;img title=":worried:" alt="😟" src="https://twemoji.ruby-china.com/2/svg/1f61f.svg" class="twemoji"&gt;  很难受&lt;/p&gt;</description>
      <author>zaqmjuop</author>
      <pubDate>Mon, 10 Jul 2017 09:24:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/33442</link>
      <guid>https://ruby-china.org/topics/33442</guid>
    </item>
  </channel>
</rss>
