2017-06-20 106 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的版本不對?或者我錯過了什麼? 任何人都可以爲我提供建議嗎?

回答