chusiang / mysql-master-master

Automatically exported from code.google.com/p/mysql-master-master
GNU General Public License v2.0
1 stars 1 forks source link

more ssh parameters for tools config #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. SSH is not running on port 22 due to security concerns
2. SSH identity file is located at a particular place
3.

What is the expected output? What do you see instead?

We are unable to connect via ssh to make backup or cloning a mysql node.

What version of the product are you using? On what operating system?

2.0.3 beta running on linux centos

Please provide any additional information below.

the thing is to add 2 parameters : 

* ssh_port (for specifying the port that is by default 22) 
* ssh_parameters (for giving other parameters to ssh by example : -i 
identity_file 

To fix this there is 2 files to modify : 

* lib/Common/Config.pm 
after the line : 
'ssh_user'                              => { 'required' => ['TOOLS'] },
add :
'ssh_port'                      => { 'default' => 22 },
'ssh_parameters'                => { 'default' => '' },

* lib/Tool/Tools.pm
line 101 : 
my $check_cmd   = "ssh $ssh_host date";
become : 
my $ssh_port    = $main::config->{host}->{$host}->{ssh_port};
my $ssh_parameters = $main::config->{host}->{$host}->{ssh_parameters};
my $check_cmd   = "ssh $ssh_parameters -p $ssh_port $ssh_host date";

after line 126:
my $ssh_host    = $main::config->{host}->{$host}->{ssh_user} . '@' . 
$main::config->{host}->{$host}->{ip};
insert : 
my $ssh_port    = $main::config->{host}->{$host}->{ssh_port};
my $ssh_parameters = $main::config->{host}->{$host}->{ssh_parameters};

line 131:
chomp(my $res = `ssh "$ssh_host" "$command"`);
become : 
chomp(my $res = `ssh $ssh_parameters -p $ssh_port $ssh_host $command`);

I have attached the modified files.

I hope it will make it to a next release...

Original issue reported on code.google.com by jfdu...@gmail.com on 2 Jun 2009 at 2:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the contribution, will include this in the next release.

Please note that we are moving from google code to launchpad - see
https://launchpad.net/mysql-mmm

Theres also a Website now: http://mysql-mmm.org

Original comment by m...@pascalhofmann.de on 2 Jun 2009 at 2:14

GoogleCodeExporter commented 9 years ago
Included into last release. See http://mysql-mmm.org/downloads

Original comment by m...@pascalhofmann.de on 3 Jun 2009 at 10:48