Adding vm.overcommit_memory kernel parameter
This commit is contained in:
parent
fad3a3febf
commit
2081ae6d7f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue