Linux / UNIX Tech Support Forum
This is a discussion on MYSQL master-master replication monitor shell script within the Databases servers forums, part of the Mastering Servers category; Hello , i have set up mysql master-master replication and it is working fine . i want to confirm on ...
|
|||||||
| Databases servers Discussions of databases of all types - especially MySQL. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello ,
i have set up mysql master-master replication and it is working fine . i want to confirm on daily basis that this setup is working as expected . is there a way to monitor it regards, Zafar |
| Sponsored Links | ||
|
|
|
||||
|
Write a shell script to Check if mysqld is alive. Here is command line version
Code:
mysqladmin -u root -h dbserver1.mycorp.com -p 'MyPASSWORD' ping Code:
#!/bin/bash mysqladmin -u root -h dbserver1.mycorp.com -p 'MyPASSWORD' ping if [ $? -ne 0 ]; then echo "Send email, mysql not running" else echo "Do nothing everything is working" fi done
__________________
Vivek Gite Linux Evangelist |
|
|||
|
My advice on multi-master replication: two is sometimes not enough. I have four servers, two of them multi-mastering and each has a slave behind it, allowing me to lose a master but still have capacity to withstand load.
Script tools I had to develop are along these lines: . snapshot replication script ( I've used this a LOT, I've had to rebuild masters and slaves commonly) . a firewall toggle script: you need to pull your database in and out of the pool but NOT disturb replication, the IP tables setup permits other databases to replicate but bars web head access when toggled . a copy of maatkit and scripts to run it across your tables effectively; think of maatkit more like a db script library than a solution itself, it can powerfully destroy your data very fast; you want to be able to tackle the challenge of corrupted tables on one master without destroying valid data that didn't replicate to the other...I've seen this happen. . a process to update the copy of mysql on your system; the default packages that come with centos, for instance, are over two years old and there's been lotsa bugs fixed in that time...that do things like crash tables . load monitoring: monitor num of threads, amount of replication lag . application error log monitoring, where are your queries failing? . ability to row-by-row compare your tables to find what data failed to replicate; maatkit can help with this but some php and a for loop might be more judicious in some instances. Consider checking a 8GB table in 10,000 row chunks to keep your table from locking up when using maatkit...then use your own script to find the row in the 10,000 row range. . don't forget mytop Good luck! |
|
||||
|
what do you want to know on the setup of Master-Master?
MySQL :: MySQL 5.0 Reference Manual :: 16 Replication Last edited by nixcraft; 09-05-2009 at 03:15 AM. |
![]() |
| Tags |
| mysql , mysql load balancing |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to monitor a particular directory and send out e-mail.... | nageshms | Shell scripting | 1 | 11-02-2008 02:01 PM |
| mysql replication information | myfoot | Shell scripting | 0 | 04-12-2007 02:24 AM |
| get data mysql from shell | alpa | Shell scripting | 1 | 14-05-2007 06:02 PM |
| Shell script to monitor remote local http or port 80 | amigo28 | Shell scripting | 1 | 12-02-2007 09:58 PM |
| Backup mysql from shell prompt or script | raj | Linux software | 0 | 29-07-2006 11:17 PM |