Open ZhaoJianchangA opened 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
}
Sometimes it makes sense to isolate ssh_port as a parameter. We can use different ssh_port in our progra.