MySQL

MySQL Replication Deadlock Recovery

Description:

A shell script (/bin/sh) that connects to a specified MySQL slave database, check the replication status for Deadlock errors (Error ‘Deadlock found when trying to get lock: try restarting transaction’) + Automatically recover from the state by performing “SLAVE STOP; SLAVE START;”

Required parameters: host, user, password.
If no Deadlock is detected, “OK” is returned
O/w, a message is printed and Warning state is returned.

Suggestions are welcome,
Moshe Kaplan

Current Version

1.0

Last Release Date

2012-02-06

Compatible With

Owner

License

BSD


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
The best practice to handle deadlocks (after eliminating them from the code) is recovering from them. Unfortunately, MySQL Replication does not recover automatically from these cases. Therefore, we decided to implement this Nagios plugin. The plugin detects the deadlock and recover from it by restart the slave ("STOP SLAVE; START SLAVE;"). Fast, Simple and very effective.
Reviews (1) Add a Review
MySQL mysqld_slave-skip-errors Option
by hasegeli, February 29, 2012
MySQL mysqld_slave-skip-errors option [1] is a better solution.

[1] http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_slave-skip-errors
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
2 (1)
Favorites
0
Views
77,119