bash - Shell script to switch processes from one server to other server in case of failovers -
i trying develop shell scripting below results:
- some cron jobs/monitoring scripts scheduled 1 primary database server.
- say if primary server fails on standby server.
- i want cron jobs/monitoring automatically start running on standby server , stop on primary server in case.
can me logic used here please?
on secondary server:
use crontab set path of command
- /bin/bash scriptname
a bashscript can attempt heartbeat server
attempt connection service
status=nmap <ipaddr> -pn -p ssh | egrep 'open|closed|filtered' if [ $status = "close" ] /path/to/command fi
Comments
Post a Comment