This commit is contained in:
2023-12-06 09:06:46 -06:00
parent 2b391900b2
commit 69a35755c4
2 changed files with 18 additions and 17 deletions

View File

@@ -764,6 +764,23 @@ REPLCHECK(){
[ "${timeout}" == "true" ] && touch ${NM_TMPFOLDER}/repl.${rcheck}.${nip}.timeout || touch ${NM_TMPFOLDER}/repl.${rcheck}.${nip}.good
}
REPLSTART(){
NODETYPE=${1}
PH=${NODETYPE}_HOSTS[0]
if [ ! -f ${NM_FOLDER}/${!PH}.down ]; then
PH_CMD="ssh root@${!PH}"
var=${NODETYPE}_REPL_CHECK[@]
if [ ! -z ${!var+x} ]; then
for rcheck in "${!var}"; do
${PH_CMD} rm -f ${NM_FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
${PH_CMD} "echo -e \"Replcation-Test\n${daterun}\" > ${NM_REPL_CHECK_LOC[${rcheck}]}/test.repl" &
${PH_CMD} 'find ${NM_REPL_CHECK_LOC[${rcheck}]} -iname "*.sync-conflict-*" -exec rm {} \;' &
done
fi
fi
}
STATUS_SCANTIMES(){
scandefault=200
while [ $# -gt 0 ]; do

View File

@@ -30,22 +30,8 @@ STATUSNEW(){
echo -en "${idsCL[LightCyan]}Setting up replication checks ... ${idsCL[Default]}"
fi
for NTYPE in "${ntypesel[@]}"; do
PH=${NTYPE}_HOSTS[0]
if [ ! -f ${NM_FOLDER}/${!PH}.down ]; then
PH_CMD="ssh root@${!PH}"
var=${NTYPE}_REPL_CHECK[@]
if [ ! -z ${!var+x} ]; then
for rcheck in "${!var}"; do
# echo "CHECK: ${NTYPE} - ${!PH} - $rcheck - ${NM_REPL_CHECK_LOC[${rcheck}]}"
${PH_CMD} rm -f ${NM_FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
${PH_CMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${NM_REPL_CHECK_LOC[${rcheck}]}/test.repl" &
${PH_CMD} 'find ${NM_REPL_CHECK_LOC[${rcheck}]} -iname "*.sync-conflict-*" -exec rm {} \;'
done
fi
fi
REPLSTART ${NTYPE} &
done
# replstart=`date +%s`
if [ "${ST_ACTION}" != "check" ]; then
echo -e "${idsCL[LightGreen]}Complete${idsCL[Default]}"
echo
@@ -277,8 +263,6 @@ It was down for $(SHOW_TIME ${toterrtime})"
var=${NTYPE}_REPL_CHECK[@]
if [ ! -z ${!var+x} ]; then
for rcheck in "${!var}"; do
${PH_CMD} rm -f ${NM_FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${PH_CMD}" = "" ]; then
rm -f ${NM_FOLDER}/test.repl &
rm -f ${NM_REPL_CHECK_LOC[${rcheck}]}/test.repl &