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

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -