michealzh / mysql-master-ha

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

Got ERROR: Use of uninitialized value in scalar chomp at /usr/lib/perl5/site_perl/5.8.8/MHA/ManagerConst.pm line 90 #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
hi:
    When I manual or automatic switching time error occurs.

    masterha_master_switch --master_state=dead --conf=/etc/app1.conf  --dead_master_host=10.58.99.69  --new_master_host=10.58.99.71                     

    Mistakes as follows:

[error][/usr/lib/perl5/site_perl/5.8.8/MHA/ManagerUtil.pm, ln178] Got ERROR: 
Use of uninitialized value in scalar chomp at 
/usr/lib/perl5/site_perl/5.8.8/MHA/ManagerConst.pm line 90.

can not switch!
Sincere advice is what causes the situation?
thanks...

Original issue reported on code.google.com by donghui....@gmail.com on 27 Jul 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Same error here. I'm on Debian wheezy, Perl version is 5.14.2

Original comment by m.je...@gmail.com on 17 Sep 2012 at 7:07

GoogleCodeExporter commented 8 years ago
It's fixed on the mainstream branch.

https://github.com/yoshinorim/mha4mysql-manager/commit/cde41fd3ff97d2b9bc8ce99bc
05af7f1d845e891

You can avoid this problem by using the latest dev tree,
or applying the above patch, or
downgrading Log::Dispatch to 2.29 or lower version.

Original comment by Yoshinor...@gmail.com on 17 Sep 2012 at 7:16

GoogleCodeExporter commented 8 years ago
OK! error has solved!
but i have a problem, source code as follows:
/*
1399     print "Enter new master host name: ";
1400     $ret = <STDIN>;
1401     chomp($ret);
1402     $new_master = $self->get_alive_server_by_hostport( $ret, 3306 );
1403 
1404     if ( !$new_master ) {
1405       die "New server not found!\n";
1406     }
*/
by default port 3306,  what parameters can dynamically change this default 
port(3306)?

I manual switching this master host,but had a problem:
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/ServerManager.pm, ln1145] 
10.58.99.69 is not alive!
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterRotate.pm, ln232] Failed to 
get new master!

I guess also is default port reason...
please explain this reason...
thanks...

Original comment by donghui....@gmail.com on 19 Sep 2012 at 6:05

GoogleCodeExporter commented 8 years ago
Set --new_master_port=xxx, and type "yes" at "Starting master switch from ...?" 
Then the logic should be skipped.

Original comment by Yoshinor...@gmail.com on 19 Sep 2012 at 6:13

GoogleCodeExporter commented 8 years ago
I also got this problem: (I didn't change the port)

masterha_master_switch --master_state=alive --conf=/xxx/masterha/conf/test.cnf 
--new_master_host=10.0.50.11 --orig_master_is_new_slave --check_only
...
Wed Feb  4 10:06:20 2015 - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. 
This may take long time..
Wed Feb  4 10:06:20 2015 - [info]  ok.
Wed Feb  4 10:06:20 2015 - [info] Checking MHA is not monitoring or doing 
failover..
Wed Feb  4 10:06:20 2015 - [info] Checking replication health on infra-test02..
Wed Feb  4 10:06:20 2015 - [info]  ok.
Wed Feb  4 10:06:20 2015 - [info] Checking replication health on infra-test03..
Wed Feb  4 10:06:20 2015 - [info]  ok.
Wed Feb  4 10:06:20 2015 - [error][/usr/local/share/perl5/MHA/ServerManager.pm, 
ln1145] 10.0.50.11 is not alive!
Wed Feb  4 10:06:20 2015 - [error][/usr/local/share/perl5/MHA/MasterRotate.pm, 
ln232] Failed to get new master!
Wed Feb  4 10:06:20 2015 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, 
ln178] Got ERROR:  at /usr/local/bin/masterha_master_switch line 53

The masterha_check_repl is all OK.

Original comment by hun...@gmail.com on 4 Feb 2015 at 10:10

GoogleCodeExporter commented 8 years ago
ah I found why, --new_master_host must be in hostname form.
But after switching:

on Master:
Master_Host: infra-test02

on other slaves:
Master_Host: 10.x.x.x

The master_host are in different formats (hostname and IP).

Original comment by hun...@gmail.com on 5 Feb 2015 at 4:34