bash - Shell script to switch processes from one server to other server in case of failovers -


i trying develop shell scripting below results:

  1. some cron jobs/monitoring scripts scheduled 1 primary database server.
  2. say if primary server fails on standby server.
  3. 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

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -