2017-06-20 97 views
0

我试图在MariaDB的24年1月10日设置HA服务器,CentOS7MariaDB的HA安装上MariaDB10.1.24,CentOS7

我设置好的复制西弗斯(master1,SLAVE1,SLAVE2)和安装mha4mysql节点-0.56.tar.gz和思想的作品好,但是当我指挥 “masterha_check_repl --conf =的/ etc/app1.cnf” 来管理服务器它显示错误

[[email protected] ~]# masterha_check_repl --conf=/etc/app1.cnf 
Tue Jun 20 11:11:30 2017 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. 
Tue Jun 20 11:11:30 2017 - [info] Reading application default configurations from /etc/app1.cnf.. 
Tue Jun 20 11:11:30 2017 - [info] Reading server configurations from /etc/app1.cnf.. 
Tue Jun 20 11:11:30 2017 - [info] MHA::MasterMonitor version 0.56. 
Tue Jun 20 11:11:32 2017 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln401] Error happend on checking configurations. Use of uninitialized value in string eq at /usr/local/share/perl5/MHA/Server.pm line 236. 
Tue Jun 20 11:11:32 2017 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln500] Error happened on monitoring servers. 
Tue Jun 20 11:11:32 2017 - [info] Got exit code 1 (Not master dead) 

在/ usr/local/share下/ perl5/MHA/MasterMonitor.pm 236行

sub check_scripts($) { 
    my $current_master = shift; 
    if ($current_master->{master_ip_failover_script}) { 
    my $command = 
"$current_master->{master_ip_failover_script} --command=status --ssh_user=$current_master->{ssh_user} --orig_master_host=$current_master->{hostname} --orig_master_ip=$current_master->{ip} --orig_master_port=$current_master->{port}"; 
    $command .= $current_master->get_ssh_args_if(1, "orig", 1); 
    $log->info("Checking master_ip_failover_script status:"); 
    $log->info(" $command"); 
    my ($high, $low) = MHA::ManagerUtil::exec_system($command, $g_logfile); 
    if ($high == 0 && $low == 0) { 
     $log->info(" OK."); 
    } 
    else { 
     $log->error(
" Failed to get master_ip_failover_script status with return code $high:$low." 
    ); 
     croak; 
    } 
    } 
    else { 
    $log->warning("master_ip_failover_script is not defined."); 
    } 

    if ($current_master->{shutdown_script}) { 
    my $command = 
"$current_master->{shutdown_script} --command=status --ssh_user=$current_master->{ssh_user} --host=$current_master->{hostname} --ip=$current_master->{ip}"; 
    $command .= $current_master->get_ssh_args_if(1, "shutdown", 1); 
    $log->info("Checking shutdown script status:"); //line 236 
    $log->info(" $command"); 
    my ($high, $low) = MHA::ManagerUtil::exec_system($command, $g_logfile); 
    if ($high == 0 && $low == 0) { 
     $log->info(" OK."); 
    } 
    else { 
     $log->error(" Failed to get power status with return code $high:$low."); 
     croak; 
    } 
    } 
    else { 
    $log->warning("shutdown_script is not defined."); 
    } 
} 

这里的app1.cnf配置(管理服务器)

[server default] 
# mysql user and password 
user=mhauser 
password=1234 
ssh_user=root 

# working directory on the manager 
manager_workdir=/home/mhauser/mysql 

# manager log file 
manager_log=/home/mhauser/mysql/mha.log 

# working directory on MySQL servers 
remote_workdir=/home/mhauser/mysql 

[server1] 
hostname=192.168.0.3 
master_binlog_dir=/usr/local/mariadb/data 
candidate_master=1 

[server2] 
hostname=192.168.0.4 
master_binlog_dir=/usr/local/mariadb/data 
candidate_master=1 

[server3] 
hostname=192.168.0.5 
master_binlog_dir=/usr/local/mariadb/data 
no_master=1 

我有没有安装MHA的版本不对?或者我错过了什么? 任何人都可以为我提供建议吗?

回答