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
1 changed files with 17 additions and 2 deletions

View File

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