Elasticsearch reports default heap memory size after setting environment variable

前端 未结 4 1588
太阳男子
太阳男子 2020-12-30 12:09

In attempt to increase JVM heap size for Elasticsearch on a Windows box, I defined the following environment variable:

ES_HEAP_SIZE=6g

(The machine has 12G R

相关标签:
4条回答
  • 2020-12-30 12:30

    For Elastic Search 1.5

    One way to do it is to edit the /bin/elasticsearch.in.sh file to default to some other value that 1g. For your example, change the ES_MAX_MEM=1g for ES_MAX_MEM=6g. After editing, restart Elastic Search and you should be good.

    #!/bin/sh
    
    ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/elasticsearch-1.5.0.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/*
    
    if [ "x$ES_MIN_MEM" = "x" ]; then
        ES_MIN_MEM=256m
    fi
    if [ "x$ES_MAX_MEM" = "x" ]; then
        ES_MAX_MEM=6g
    fi
    if [ "x$ES_HEAP_SIZE" != "x" ]; then
        ES_MIN_MEM=$ES_HEAP_SIZE
        ES_MAX_MEM=$ES_HEAP_SIZE
    fi
    
    0 讨论(0)
  • 2020-12-30 12:37

    To avoid service re-install you can directly change values in registry. They are a bit tricky to find:

    Of course, you have to restart the service after changing these settings.

    0 讨论(0)
  • 2020-12-30 12:45

    From the notes on running ES as a service on windows:

    Note that the environment configuration options available during the installation are copied and will be used during the service lifecycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.

    If you don't want to uninstall and re-install, you can use the service manager to make the change. Run >service manager

    Then select the 'Java' Tab

    Java Tab

    Change the memory pool settings, hit 'Apply' and restart the service.

    enter image description here

    0 讨论(0)
  • 2020-12-30 12:48

    After I had uninstalled and reinstalled Elasticsearch Windows service, it correctly increased the JVM heap size. Just restarting it without reinstalling the service didn't work.

    0 讨论(0)
提交回复
热议问题