0

I am trying to install elastic search in Linux VM but could not able to start the service though it has java installed. I am getting following message while elasticsearch script runs.

[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

I have downlaoded 2.3.2 from elastic search website. After initial google I did set the ES_HEAP_SIZE=1g in bash_profile but still no luck. Can you thow some light what could be issue.

Thanks

2 Answers2

0

It seems you don't have enough heap space to start elastic. Please go to increase the java heap size permanently? and do the needful.

Community
  • 1
  • 1
Navin Rawat
  • 3,208
  • 1
  • 19
  • 31
  • I dont think so. Same distribution does work well in mac os or physical mahcine. But in VM. I think distribution itself has some issue. – user3854756 Apr 30 '16 at 19:11
0

Depending on the flavor of Linux you are using, you may need to use a text editor to update the following file to increase the heap size.

/etc/sysconfig/elasticsearch (uncomment the line 'ES_HEAP_SIZE=' and set this to half of the allocated virtual RAM for the VM)--Based on: https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html

I will caution you to read this as well afterwards if you see something like "Unable to lock JVM memory" in your elasticsearch application log after starting it up: https://github.com/elastic/elasticsearch/issues/9357

I ran into problems myself with trying to use the environment variable method on Centos 6 and 7.

You may also want to try using the Kopf plugin (open source) to get some simple visibility: https://github.com/lmenezes/elasticsearch-kopf

Using the following general instructions of course: https://www.elastic.co/guide/en/elasticsearch/plugins/current/installation.html

If you don't know where certain things are located for elasticsearch on your system, please use the below defaults listing as guidance:

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

The root cause of the problem you are experiencing is most likely related to the startup script being used to bring up your instance of elasticsearch on the VM and it not utilizing the environment variable as expected. I hope you don't mind the extra information, I'm just trying to help you save some time.