无法在 Ubuntu 上将 ElasticSearch 作为服务运行 [英] Unable to run ElasticSearch as a service on Ubuntu
问题描述
我正在尝试按照正常的 设置指南.
I'm trying to get ElasticSearch up and running following the normal setup guide.
在我的 Macbook 上一切正常,但我正在尝试在 Ubuntu 11.04 服务器上做同样的事情.
Everything is running fine on my Macbook but I'm trying to do the same on an Ubuntu 11.04 server.
运行 /usr/local/elasticsearch/bin/elasticsearch -f
有效,我从 curl http://localhost:9200
得到响应.
Running /usr/local/elasticsearch/bin/elasticsearch -f
works and I get a response from curl http://localhost:9200
.
然而,这是我尝试将 ElasticSearch 作为服务启动时得到的结果(我已经安装了服务包装器):
However this is what I get when I try to start ElasticSearch as a service (I've installed the service wrapper):
$ rcelasticsearch start
Starting ElasticSearch...
Waiting for ElasticSearch.............................
WARNING: ElasticSearch may have failed to start.
果然 rcelasticsearch status
说 ElasticSearch 没有运行
并且无法访问 localhost:9200.
Sure enough rcelasticsearch status
says ElasticSearch is not running
and localhost:9200 cannot be reached.
任何想法可能是什么问题?
Any ideas what might be the problem?
服务日志说:
Launching a JVM...
JVM exited while loading the application.
Error occurred during initialization of VM
Could not reserve enough space for object heap
推荐答案
服务器实例没有足够的内存用于默认的 ElasticSearch 服务包装器设置.为了解决这个问题,我编辑了 /usr/local/elasticsearch/bin/service/elasticsearch.conf
并将 ES_HEAP_SIZE
从 1024 更改为 512
The server instance didn't have enough memory for the default ElasticSearch service wrapper settings. To fix this I edited /usr/local/elasticsearch/bin/service/elasticsearch.conf
and changed ES_HEAP_SIZE
from 1024 to 512
这篇关于无法在 Ubuntu 上将 ElasticSearch 作为服务运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!