Adding vm.overcommit_memory kernel parameter

This commit is contained in:
Philippe Caseiro 2018-06-13 09:42:28 +02:00
parent fad3a3febf
commit 2081ae6d7f

View File

@ -113,6 +113,14 @@ function redisClusterIsOK()
}
CONF="/etc/redis/cluster.conf"
INITFLAG="/usr/share/eole/redisinit.flg"
sysConf=$(grep "vm.overcommit_memory" /etc/sysctl.conf 2>&1 > /dev/null)
if [[ ${?} -ne 0 ]]
then
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
fi
[[ ! -e ${CONF} ]] && exit 0
@ -138,7 +146,7 @@ do
master=${li[4]}
ntype=${li[5]}
if [[ ${ntype} == "Leader" ]]
if [[ ${ntype} == "Leader" ]]
then
LeaderIP=${ip}
LeaderPort=${port}
@ -152,7 +160,7 @@ done < ${CONF}
# If the cluster is "ok" don't do anything
st=$(redisClusterIsOK ${LeaderIP} ${LeaderPort})
#[[ ${?} -eq 0 ]] && exit 0
[[ ${?} -eq 0 ]] && exit 0
if [[ ${1} == "forget" ]]
then
@ -160,6 +168,13 @@ then
exit ${?}
fi
if [[ -e ${INITFLAG} ]]
then
echo "Init allready done ... nothing to do"
exit 0
fi
echo " * Organise Cluster Meeting."
for node in ${NAMES[@]}
do