【问题标题】:Not able to start Elastic Search in Linux VM无法在 Linux VM 中启动弹性搜索
【发布时间】:2016-05-05 00:35:12
【问题描述】:

我正在尝试在 Linux VM 中安装弹性搜索,但尽管安装了 java,但无法启动该服务。 elasticsearch 脚本运行时收到以下消息。

[xxxx@ABCWCW0ASMGNJ01A bin]$ java -version java version "1.7.0_65" OpenJDK Runtime Environment (novell-2.5.1.2.el6_5-x86_64 u65-b17) OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode) [xxxx@ABCWCW0ASMGNJ01A bin]$ ./elasticsearch Error occurred during initialization of VM Too small initial heap for new size specified

我从弹性搜索网站下载了 2.3.2。在最初的谷歌之后,我确实在 bash_profile 中设置了 ES_HEAP_SIZE=1g 但仍然没有运气。你能解释一下可能是什么问题吗?

谢谢

【问题讨论】:

  • vm的内存信息是什么?
  • 大约有 32G。只是为了给更多的指点,我在WINDOWS机器上试了一下,效果很好。
  • 你有 32gb 内存吗?
  • 是的。 [xxxx@ABCWCW0ASMGNJ01A bin]$ free -m -t total used free shared buffers cached Mem: 32106 20504 11602 0 571 4702 -/+ buffers/cache: 15230 16876 Swap: 8191 69 8122 Total: 40298 20573 19725

标签: elasticsearch


【解决方案1】:

您似乎没有足够的堆空间来启动弹性。请转到increase the java heap size permanently? 并做必要的事情。

【讨论】:

  • 我不这么认为。相同的发行版在 mac os 或物理机器中运行良好。但是在虚拟机中。我认为分发本身存在一些问题。
【解决方案2】:

根据您使用的 Linux 风格,您可能需要使用文本编辑器更新以下文件以增加堆大小。

/etc/sysconfig/elasticsearch (取消注释 'ES_HEAP_SIZE=' 行并将其设置为 VM 分配的虚拟 RAM 的一半)--基于:https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html

如果您在启动后在弹性搜索应用程序日志中看到类似“无法锁定 JVM 内存”的内容,我会提醒您稍后阅读此内容: https://github.com/elastic/elasticsearch/issues/9357

我自己在尝试在 Centos 6 和 7 上使用环境变量方法时遇到了问题。

您可能还想尝试使用 Kopf 插件(开源)来获得一些简单的可见性: https://github.com/lmenezes/elasticsearch-kopf

当然使用以下一般说明: https://www.elastic.co/guide/en/elasticsearch/plugins/current/installation.html

如果您不知道弹性搜索在系统上的某些位置,请使用以下默认列表作为指导:

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-dir-layout.html

您遇到问题的根本原因很可能与用于在 VM 上启动您的 elasticsearch 实例的启动脚本有关,并且它没有按预期使用环境变量。希望您不要介意额外的信息,我只是想帮助您节省一些时间。

【讨论】:

    猜你喜欢
    • 2021-10-10
    • 2015-03-14
    • 1970-01-01
    • 2016-02-27
    • 1970-01-01
    • 2018-02-13
    • 2015-04-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多