Elasticsearch reports default heap memory size after setting environment variable

前端 未结 4 1609
太阳男子
太阳男子 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
    

提交回复
热议问题