Skip to content

DRBD resource watchdog script to bounce resource on secondary node if its stuck in OutOfDate state.

Notifications You must be signed in to change notification settings

z4phodB/drbdwatch.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

drbdwatch.sh

DRBD resource watchdog script to bounce resource on secondary node if its too far out of sync (oos) and stalled.

Note: Only supported for DRBD version 9.

Usage: ./drbdwatch.sh <resource name>

Suggest running this in cron every minute to ensure drbd does not remain out of sync very long
Add more lines for each resource you want to monitor
Example: */1 * * * * bash -l -c '/usr/local/bin/drbdwatch.sh r0' > /dev/null 2>&1

Variables near the top of script can be tuned. Here are the defaults:
OOS_MAX=256000 #256KB
SYNC_TIMEOUT=1800 #30 Minutes

Configuration:
    Edit LOGFILE and LOCKFILE variables if desired
    Note, LOCKFILE must include the resource variable to ensure uniqueness if running multiple drbdwatch.sh instances
    Defaults:
        LOGFILE="/var/log/drbdwatch.log"
        LOCKFILE="/tmp/.DRDBSYNC_$RESOURCE"

About

DRBD resource watchdog script to bounce resource on secondary node if its stuck in OutOfDate state.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages