elasticsearch未能以centos开始

时间:2016-11-06 15:51:54

标签: elasticsearch centos

centos 6.7,elasticsearch 5

我已经使用rpm安装了elasticsearch。但未能启动它。

error: permission denied on key 'vm.max_map_count'
Starting elasticsearch: /usr/share/elasticsearch/bin/elasticsearch: line 198:   875 Killed                  exec "$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.bootstrap.Elasticsearch "$@" 0>&-
                                                           [FAILED]

2 个答案:

答案 0 :(得分:0)

我认为您应该将vm.max_map_count设置为适当的值。

https://www.elastic.co/guide/en/elasticsearch/reference/current/_maximum_map_count_check.htmlhttps://github.com/elastic/elasticsearch/issues/4978

应该解决你的问题:

sudo sysctl -w vm.max_map_count=262144

答案 1 :(得分:0)

e.g。编辑(vi / vim)/etc/init.d/elastic_search(或者你拼写),然后改变,

CURRENT_MAX_MAP_COUNT=`sysctl vm.max_map_count | cut -d'=' -f2`;
if [ -n "$MAX_MAP_COUNT" -a -f /proc/sys/vm/max_map_count ]; then
    if [ $MAX_MAP_COUNT -gt $CURRENT_MAX_MAP_COUNT ]; then
        sysctl -q -w vm.max_map_count=$MAX_MAP_COUNT
    fi
fi