Error Running ElasticSearch


(timscott) #1

When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the
following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.


(Shay Banon) #2

How much memory do you have allocated for that Ubuntu VM?
On Tuesday, February 15, 2011 at 6:46 AM, Tim Scott wrote:
When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the

following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.


(timscott) #3

1024Mb. ElasticSearch is the only thing running on that VM.

I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.

Surely 1Gb is enough with nothing else running? Do I need to up it?

On Feb 14, 10:51 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

How much memory do you have allocated for that Ubuntu VM?On Tuesday, February 15, 2011 at 6:46 AM, Tim Scott wrote:

When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the

following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.


(Shay Banon) #4

By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will slowly increase its size and consume that memory (thats why its recommended to have MIN and MAX set to the same value).

You can decrease ES_MAX_MEM to a lower value (say, 512m).
On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:

1024Mb. ElasticSearch is the only thing running on that VM.

I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.

Surely 1Gb is enough with nothing else running? Do I need to up it?

On Feb 14, 10:51 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

How much memory do you have allocated for that Ubuntu VM?On Tuesday, February 15, 2011 at 6:46 AM, Tim Scott wrote:

When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the

following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.


(timscott) #5

Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:

ES_MIN_MEM = "512m"

It runs without error, but I don't know how to tell if it's working.

Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?

I apologize for asking what are probably very basic Linux admin
questions here. I have a lot to learn about basic Linux admin and ES
admin. Thanks.

On Feb 15, 8:05 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will slowly increase its size and consume that memory (thats why its recommended to have MIN and MAX set to the same value).

You can decrease ES_MAX_MEM to a lower value (say, 512m).

On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:

1024Mb. ElasticSearch is the only thing running on that VM.

I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.

Surely 1Gb is enough with nothing else running? Do I need to up it?

On Feb 14, 10:51 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

How much memory do you have allocated for that Ubuntu VM?On Tuesday, February 15, 2011 at 6:46 AM, Tim Scott wrote:

When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the

following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.


(Clinton Gormley) #6

On Wed, 2011-02-16 at 09:28 -0800, Tim Scott wrote:

Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:

ES_MIN_MEM = "512m"

You probably also want to set ES_MAX_MEM

Also, you may find the service wrapper helpful:

Here are some instructions ( a bit out of date) for setting up ES with
the service wrapper:

http://www.elasticsearch.org/tutorials/2010/07/01/setting-up-elasticsearch.html

Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?

Yes you have. Just look for a java process with 'elasticsearch' in the
name, eg on linux:

ps ax | grep elastic

and send it a kill signal

clint


(Lukáš Vlček) #7

Tim,

On Wed, Feb 16, 2011 at 6:28 PM, Tim Scott tscott@lunaversesoftware.comwrote:

Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:

ES_MIN_MEM = "512m"

I am not sure about quotes. Try using ES_MIN_MEM=512m

It runs without error, but I don't know how to tell if it's working.

Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?

If it is an ES node (note there can be running some other process, not
related to ES at all, ES simply binds to the first empty port starting from
9200, if not configured otherwise) then you can simply kill it or send a
_shutdown request over REST API, see
http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown.html

If you want to kill the process from command line then you need to know the
PID. You can either learn this by running "ps -ef | grep elastic" or
directly from Admin API
http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-info.html
(but
this requires scanning of returned JSON data)

I apologize for asking what are probably very basic Linux admin
questions here. I have a lot to learn about basic Linux admin and ES
admin. Thanks.

On Feb 15, 8:05 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will
slowly increase its size and consume that memory (thats why its recommended
to have MIN and MAX set to the same value).

You can decrease ES_MAX_MEM to a lower value (say, 512m).

On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:

1024Mb. ElasticSearch is the only thing running on that VM.

I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.

Surely 1Gb is enough with nothing else running? Do I need to up it?

On Feb 14, 10:51 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

How much memory do you have allocated for that Ubuntu VM?On Tuesday,
February 15, 2011 at 6:46 AM, Tim Scott wrote:

When I try to run ElasticSearch (on a Linux Ubuntu VM) I get the

following error:

Error occurred during initialization of VM
Could not reserve enough space for object heap

I am a Linux/Java dummy. I realize this is probably not purely an
ES

issue, but I hope someone can point me in the right direction.
Thanks.

Regards,
Lukas


(system) #8