3

Elasticsearch 1.7.2 on CentOS, 8GB RAM

We see that ES_HEAP_SIZE should be increased to 4g.

The only place this seems declared in the ES environment is in /etc/init.d/elasticsearch

We set it to 4g in this init file, restarted ES, but the jvm "heap_max_in_bytes" (as returned from /_nodes/stats ) did not move from the default 1g value.

Where and how can we get control of ES_HEAP_SIZE ?

(I should add: The similar looking threads here on SO are either dated [e.g. apply to earlier versions of ES and do not apply to 1.7.x] or are for other platforms [win, osx], or are do not work [have tried them, and you can see many of the responses are tagged 'this is a hack don't do it'])

(I should further note that the ES docs document this element, and suggest what to set it to, but do not instruct how or where.)

Jonesome Reinstate Monica
  • 6,618
  • 11
  • 65
  • 112
  • does this http://stackoverflow.com/questions/18132719/how-to-change-elasticsearch-max-memory-size help? according to that you should look into `/etc/sysconfig/elasticsearch` . – ChintanShah25 Nov 24 '15 at 20:50
  • @ChintanShah25 Yes, that is the ticket. It is rather buried in a comment on that thread. Posted it here in clear as an answer. Thank you! – Jonesome Reinstate Monica Nov 24 '15 at 21:32

1 Answers1

2

Note: Below is for Elasticsearch 1.7.x. For 5.3 and higher, it is different.

Per a comment that is rather buried on How to change Elasticsearch max memory size

On CentOS /etc/sysconfig/elasticsearch is the appropriate place to make these changes.

This has been tested and verified on my CentOS 7 environment. Strongly expect it to also fly on CentOS 6.

Jonesome Reinstate Monica
  • 6,618
  • 11
  • 65
  • 112