Update the elasticsearch cookbook

This commit is contained in:
Greg Karékinian
2023-06-29 16:39:09 +02:00
parent 68ce3c4834
commit 7683de09a2
48 changed files with 2016 additions and 2065 deletions

View File

@@ -33,7 +33,7 @@ fi
# Sets the default values for elasticsearch variables used in this script
ES_HOME="/usr/share/elasticsearch"
MAX_OPEN_FILES=65536
MAX_OPEN_FILES=65535
MAX_MAP_COUNT=262144
ES_PATH_CONF="/etc/elasticsearch"
@@ -69,21 +69,7 @@ if [ ! -x "$exec" ]; then
exit 1
fi
checkJava() {
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=`which java`
fi
if [ ! -x "$JAVA" ]; then
echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME"
exit 1
fi
}
start() {
checkJava
[ -x $exec ] || exit 5
if [ -n "$MAX_OPEN_FILES" ]; then
@@ -92,7 +78,7 @@ start() {
if [ -n "$MAX_LOCKED_MEMORY" ]; then
ulimit -l $MAX_LOCKED_MEMORY
fi
if [ -n "$MAX_MAP_COUNT" -a -f /proc/sys/vm/max_map_count ]; then
if [ -n "$MAX_MAP_COUNT" -a -f /proc/sys/vm/max_map_count ] && [ "$MAX_MAP_COUNT" -gt $(cat /proc/sys/vm/max_map_count) ]; then
sysctl -q -w vm.max_map_count=$MAX_MAP_COUNT
fi