vcdog / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 1 forks source link

Running masterha_master_switch errors with DBI connect #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. masterha_master_switch --master_state=alive --conf=/vol/mha/mapi_qa.cnf 
--new_master_host=xx.xxx.xxx.xxx --orig_master_is_new_slave

2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
0.53

Please provide any additional information below.

Trying to do a manual failover and am getting the following error:
Starting master switch from xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306) to 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306)? (yes/NO): yes
Tue Feb 21 19:29:19 2012 - [info] Checking whether 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306) is ok for the new master..
Tue Feb 21 19:29:19 2012 - [info]  ok.
Tue Feb 21 19:29:19 2012 - [info] xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306): SHOW 
SLAVE STATUS returned empty result. To check replication filtering rules, 
temporarily executing CHANGE MASTER to a dummy host.
Tue Feb 21 19:29:19 2012 - [info] xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306): 
Resetting slave pointing to the dummy host.
Tue Feb 21 19:29:19 2012 - [info] ** Phase 1: Configuration Check Phase 
completed.
Tue Feb 21 19:29:19 2012 - [info] 
Tue Feb 21 19:29:19 2012 - [debug]  Disconnected from 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306)
Tue Feb 21 19:29:19 2012 - [info] * Phase 2: Rejecting updates Phase..
Tue Feb 21 19:29:19 2012 - [info] 
Tue Feb 21 19:29:19 2012 - [info] Executing master ip online change script to 
disable write on the current master:
Tue Feb 21 19:29:19 2012 - [info]   /vol/mha/master_ip_online_change 
--command=stop --orig_master_host=xx.xxx.xxx.xxx 
--orig_master_ip=xx.xxx.xxx.xxx --orig_master_port=3306 
--new_master_host=xx.xxx.xxx.xxx --new_master_ip=xx.xxx.xxx.xxx 
--new_master_port=3306  
Got Error: DBI 
connect(';host=xx.xxx.xxx.xxx;port=3306;mysql_connect_timeout=4','root',...) 
failed: Access denied for user 'root'@'xx.xxx.xxx.xxx' (using password: YES) at 
/usr/local/share/perl5/MHA/DBHelper.pm line 181
 at /vol/mha/master_ip_online_change line 122

Tue Feb 21 19:29:20 2012 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, 
ln178] Got ERROR:  at /usr/local/bin/masterha_master_switch line 53
Tue Feb 21 19:29:20 2012 - [debug]  Already disconnected from 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306)
Tue Feb 21 19:29:20 2012 - [debug]  Disconnected from 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306)
Tue Feb 21 19:29:20 2012 - [debug]  Disconnected from 
xx.xxx.xxx.xxx(xx.xxx.xxx.xxx:3306)

Am I doing something wrong?  auto failover with masterha_manager running seems 
to work fine... I can alos connect to each mysql host from all the involved 
databases in the cluster

Original issue reported on code.google.com by danoyo...@gmail.com on 21 Feb 2012 at 7:33

GoogleCodeExporter commented 9 years ago
I've also connected via DBI from the mha-manager box to all the mysql 
instances, with the root account using the following script:

use strict;
use DBI;
my $dbh;
##
$dbh = DBI->connect('DBI:mysql:database=mydb;host=xx.xxx.xxx.xxx', 'root', 
'passwd') || die 
$dbh->disconnect();

Original comment by danoyo...@gmail.com on 21 Feb 2012 at 7:45

GoogleCodeExporter commented 9 years ago
I think I see the problem:

main::main(/vol/mha/master_ip_online_change:122):
122:          $new_master_handler->connect( $new_master_ip, $new_master_port, 
"root",
123:            "rootpass", 1 );

Shouldn't the "rootpass" be pulled in form the config somewhere? I don't want 
to hard code this in the script, I think that might be the issue....

Original comment by danoyo...@gmail.com on 21 Feb 2012 at 8:02

GoogleCodeExporter commented 9 years ago
ok, that was it...I'll figure out the password stuff, sorry for the noise... :(

Original comment by danoyo...@gmail.com on 21 Feb 2012 at 8:15

GoogleCodeExporter commented 9 years ago

Original comment by Yoshinor...@gmail.com on 22 Feb 2012 at 10:51