summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-10-28 17:56:50 +0530
committerVenky Shankar <vshankar@redhat.com>2015-11-24 23:18:38 -0800
commita2c977fad73aa2df5eb5ffd51bc708354a08b88f (patch)
treeabe0dc2d86d54a23807be66ff640e9263b35803b /geo-replication/syncdaemon
parent1952143a3c9639a00fe5e52e4368ea9f380a0172 (diff)
geo-rep: New Config option for ssh_port
If different port used for SSH instead of 22, Geo-replication was failing to establish SSH connection. ssh_port option can be added using config:ssh_command and config:ssh_command_tar, but user has to remember complete ssh command used with parameter to add/modify ssh port. This patch adds new config option for ssh_port, gluster volume geo-replication <MASTERVOL> <SLAVEHOST::<SLAVEVOL> \ config ssh_port 52022 Change-Id: I7753a09485f0b1f49d2b2a80b962c720817c96f4 Signed-off-by: Aravinda VK <avishwan@redhat.com> BUG: 1283060 Reviewed-on: http://review.gluster.org/12444 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> (cherry picked from commit 7d35eb5926869ed084295600502a85ce13be506f) Reviewed-on: http://review.gluster.org/12607 Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/gsyncd.py1
-rw-r--r--geo-replication/syncdaemon/resource.py10
2 files changed, 8 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py
index b3c7e62506e..d7e9486d09c 100644
--- a/geo-replication/syncdaemon/gsyncd.py
+++ b/geo-replication/syncdaemon/gsyncd.py
@@ -247,6 +247,7 @@ def main_i():
op.add_option(
'--local-path', metavar='PATH', help=SUPPRESS_HELP, default='')
op.add_option('-s', '--ssh-command', metavar='CMD', default='ssh')
+ op.add_option('--ssh-port', metavar='PORT', type=int, default=22)
op.add_option('--ssh-command-tar', metavar='CMD', default='ssh')
op.add_option('--rsync-command', metavar='CMD', default='rsync')
op.add_option('--rsync-options', metavar='OPTS', default='')
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 8869a109cf9..606e149a7a1 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -960,6 +960,7 @@ class SlaveRemote(object):
tar_cmd = ["tar"] + \
["-cf", "-", "--files-from", "-"]
ssh_cmd = gconf.ssh_command_tar.split() + \
+ ["-p", str(gconf.ssh_port)] + \
[host, "tar"] + \
["--overwrite", "-xf", "-", "-C", rdir]
p0 = Popen(tar_cmd, stdout=subprocess.PIPE,
@@ -1540,8 +1541,9 @@ class SSH(AbstractUrl, SlaveRemote):
self.inner_rsc.url)
deferred = go_daemon == 'postconn'
- ret = sup(self, gconf.ssh_command.split() + gconf.ssh_ctl_args +
- [self.remote_addr],
+ ret = sup(self, gconf.ssh_command.split() +
+ ["-p", str(gconf.ssh_port)] +
+ gconf.ssh_ctl_args + [self.remote_addr],
slave=self.inner_rsc.url, deferred=deferred)
if deferred:
@@ -1565,7 +1567,9 @@ class SSH(AbstractUrl, SlaveRemote):
def rsync(self, files):
return sup(self, files, '-e',
- " ".join(gconf.ssh_command.split() + gconf.ssh_ctl_args),
+ " ".join(gconf.ssh_command.split() +
+ ["-p", str(gconf.ssh_port)] +
+ gconf.ssh_ctl_args),
*(gconf.rsync_ssh_options.split() + [self.slaveurl]))
def tarssh(self, files):