yoshinorim / mha4mysql-manager

Development tree of Master High Availability Manager and tools for MySQL (MHA), Manager part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
1.46k stars 501 forks source link

There is no ssh_port parameter in the master_ip_failover template #131

Open ZhaoJianchangA opened 4 years ago

ZhaoJianchangA commented 4 years ago

Sometimes it makes sense to isolate ssh_port as a parameter. We can use different ssh_port in our progra.

michael-liumh commented 4 years ago

you can add ssh_port parameter into master_ip_failover. For example:

my $vip = '192.168.1.20'; # Virtual IP my $key = "1"; my $ssh_start_vip = "/sbin/ifconfig eth0:$key $vip"; my $ssh_stop_vip = "/sbin/ifconfig eth0:$key down"; my $ssh_port = "33322"; # <--- add my $ssh_port parameter here

elsif ( $command eq "status" ) {
    print "Checking the Status of the script.. OK \n";
    `ssh $ssh_user\@$orig_master_host -p $ssh_port \" $ssh_start_vip \"`;      # <--- add -p $ssh_port parameter here
    exit 0;
}

sub start_vip() { ssh $ssh_user\@$new_master_host -p $ssh_port \" $ssh_start_vip \"; # <--- add -p $ssh_port parameter here }

sub stop_vip() { ssh $ssh_user\@$orig_master_host -p $ssh_port \" $ssh_stop_vip \"; # <--- add -p $ssh_port parameter here }