04-18-2011
Strategical Shell Scripting For MySql Replication
Hi to all guyz ,
As i'm new to Shell scripting i was been working out to write a shell script for mysql Replication for multiple slave master architecture.i have done the process up with a script of 200 lines but still there are some things which can make my script more effective so i want your help to solve this script run like a pro
here is the problem i'm facing now
there is a table in the database by name Ipmonitor and in that i have a master ip and some slave ip's and the slave status will be in "0" and master ip will be as "1".if my master ip gets down it will check for a good slave to make it as new master and it deletes the old master record in the table and assigns new master's status as "1".after that selected ip will be the new master .now the real problem starts is dat i want to write a for loop to checkout the ip's and make the other ip's to route to the new master ip....so how can i write the shell script to check the slaves present apart from the ip which has been changed from slave to master.
Advance thanks to guys who help me out in this problem
5 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have written a shell script for oracle on unix that does a df for specific files, and then will display the size, Avail, % used and the difference from yesterday to today.
I have been asked to place it on some MySql databases that run onn unix and linux also, but when I try to run them I... (2 Replies)
Discussion started by: cat55
2 Replies
2. Web Development
Lately my attention has been focused on distributed MySQL database replication to other web servers. All was going well, but then I noticed the replication would stop and there were there "Duplicate Primary Key" errors in SHOW SLAVE STATUS;
I started to trace these down and noticed that this... (2 Replies)
Discussion started by: Neo
2 Replies
3. Shell Programming and Scripting
Hi All,
Please see the below script for mysql 3 commands. Its giving me the right output for all three commands but showing some errors in first two commands , i guess there might be an issue with date.
Can anyone help me .
#! /bin/bash
TABLE_NAME=testingddatabase
USER_NAME=root... (3 Replies)
Discussion started by: aish11
3 Replies
4. Linux
Need to recover a replication broken error on the mysql slave server.
I want to force it to resend the binlog file from the begining.
What is the correct value for the: MASTER_LOG_POS ?
0, 1 or 107 ? (2 Replies)
Discussion started by: andriesh
2 Replies
5. UNIX Desktop Questions & Answers
I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database.
For this I have created two... (0 Replies)
Discussion started by: Palak Sharma
0 Replies
LEARN ABOUT CENTOS
cpanplus::shell
CPANPLUS::Shell(3) User Contributed Perl Documentation CPANPLUS::Shell(3)
NAME
CPANPLUS::Shell - base class for CPANPLUS shells
SYNOPSIS
use CPANPLUS::Shell; # load the shell indicated by your
# config -- defaults to
# CPANPLUS::Shell::Default
use CPANPLUS::Shell qw[Classic] # load CPANPLUS::Shell::Classic;
my $ui = CPANPLUS::Shell->new();
my $name = $ui->which; # Find out what shell you loaded
$ui->shell; # run the ui shell
DESCRIPTION
This module is the generic loading (and base class) for all "CPANPLUS" shells. Through this module you can load any installed "CPANPLUS"
shell.
Just about all the functionality is provided by the shell that you have loaded, and not by this class (which merely functions as a generic
loading class), so please consult the documentation of your shell of choice.
BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell::Classic, cpanp
perl v5.16.3 2013-05-20 CPANPLUS::Shell(3)