Update nodemgmt-scripts.sh

This commit is contained in:
2019-03-06 13:19:04 -06:00
parent 15d2170eda
commit 7eb0688aac

View File

@@ -43,17 +43,19 @@ STATUS(){
# else # else
# NHCMD='' # NHCMD=''
# fi # fi
for rcheck in "${NODE_REPL_CHECK[@]}"; do if [ ! -z ${NODE_REPL_CHECK+x} ]; then
${NHCMD} rm -f ${FOLDER}/test.repl for rcheck in "${NODE_REPL_CHECK[@]}"; do
daterun=`date +%Y-%m-%d-%H-%M-%S` ${NHCMD} rm -f ${FOLDER}/test.repl
if [ "${NHCMD}" = "" ]; then daterun=`date +%Y-%m-%d-%H-%M-%S`
echo -e "MySQL-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl if [ "${NHCMD}" = "" ]; then
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl echo -e "MySQL-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
else yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl" else
yes | ${NHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl" ${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
fi yes | ${NHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
done fi
done
fi
for rcheck in "${WEB_REPL_CHECK[@]}"; do for rcheck in "${WEB_REPL_CHECK[@]}"; do
${WHCMD} rm -f ${FOLDER}/test.repl ${WHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S` daterun=`date +%Y-%m-%d-%H-%M-%S`
@@ -319,10 +321,10 @@ STATUS(){
echo -e "${idsCL[Yellow]} Replication Status Between the Primary and Secondary Nodes${idsCL[Default]}" echo -e "${idsCL[Yellow]} Replication Status Between the Primary and Secondary Nodes${idsCL[Default]}"
DIVIDER; echo -e "${idsST[Reset]}" DIVIDER; echo -e "${idsST[Reset]}"
fi fi
if [ -z ${NODE_REPL_CHECK+x} ]; then if [ ! -z ${NODE_REPL_CHECK+x} ]; then
nid=1 nid=1
for nip in "${NODE_HOSTS[@]}"; do for nip in "${NODE_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" = "${NODE_HOSTS[0]}" ]; then if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" != "${NODE_HOSTS[0]}" ]; then
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then
echo -e " ${idsCL[LightCyan]}MySQL-Node1 (${NODE_HOSTS[0]}) <--> ${idsST[Bold]}MySQL-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}" echo -e " ${idsCL[LightCyan]}MySQL-Node1 (${NODE_HOSTS[0]}) <--> ${idsST[Bold]}MySQL-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green DIVIDER false green
@@ -388,7 +390,7 @@ STATUS(){
fi fi
nid=1 nid=1
for nip in "${WEB_HOSTS[@]}"; do for nip in "${WEB_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" = "${WEB_HOSTS[0]}" ]; then if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" != "${WEB_HOSTS[0]}" ]; then
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then
echo -e " ${idsCL[LightCyan]}Webserver-Node1 (${WEB_HOSTS[0]}) <--> ${idsST[Bold]}Webserver-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}" echo -e " ${idsCL[LightCyan]}Webserver-Node1 (${WEB_HOSTS[0]}) <--> ${idsST[Bold]}Webserver-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green DIVIDER false green