2016-11-06 86 views
0

centos 6.7,elasticsearch 5elasticsearch未能在centos中啓動

我已經安裝了使用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 "[email protected]" 0>&- 
                  [FAILED] 

回答

0

例如編輯(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