summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-08 09:18:43 +0000
committerAnand Avati <avati@gluster.com>2011-06-08 11:19:17 -0700
commitc9f61338fadc69ad1da6f8100fe0c37057d622a0 (patch)
tree040f6020253ca76aecaad3f8bb7fd22a419823b2 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent84eca97a940fc1cad339e9238528c29cfcf9ac42 (diff)
fix multiple transport related portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2294 (Currently there is no way through cli to make a volume listen on both the transports (socket/rdma)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2294
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 8cb8f8f830e..e07ce143b19 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1024,6 +1024,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
char exp_path[PATH_MAX] = {0,};
char logfile[PATH_MAX] = {0,};
int port = 0;
+ int rdma_port = 0;
FILE *file = NULL;
gf_boolean_t is_locked = _gf_false;
char socketpath[PATH_MAX] = {0};
@@ -1107,12 +1108,27 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
if (!port)
port = pmap_registry_alloc (THIS);
- snprintf (cmd_str, 8192,
- "%s/sbin/glusterfsd --xlator-option %s-server.listen-port=%d "
- "-s localhost --volfile-id %s -p %s -S %s --brick-name %s "
- "--brick-port %d -l %s", GFS_PREFIX, volinfo->volname,
- port, volfile, pidfile, socketpath, brickinfo->path, port,
- brickinfo->logfile);
+ if (volinfo->transport_type != GF_TRANSPORT_BOTH_TCP_RDMA) {
+ snprintf (cmd_str, 8192,
+ "%s/sbin/glusterfsd --xlator-option %s-server.listen-port=%d "
+ "-s localhost --volfile-id %s -p %s -S %s --brick-name %s "
+ "--brick-port %d -l %s", GFS_PREFIX, volinfo->volname,
+ port, volfile, pidfile, socketpath, brickinfo->path, port,
+ brickinfo->logfile);
+ } else {
+ rdma_port = brickinfo->rdma_port;
+ if (!rdma_port)
+ rdma_port = pmap_registry_alloc (THIS);
+
+ snprintf (cmd_str, 8192,
+ "%s/sbin/glusterfsd --xlator-option %s-server.listen-port=%d "
+ "--xlator-option %s-server.transport.rdma.listen-port=%d -s localhost "
+ "--volfile-id %s -p %s -S %s --brick-name %s "
+ "--brick-port %d,%d -l %s", GFS_PREFIX, volinfo->volname,
+ port, volinfo->volname, rdma_port, volfile, pidfile,
+ socketpath, brickinfo->path, port, rdma_port,
+ brickinfo->logfile);
+ }
gf_log ("",GF_LOG_DEBUG,"Starting GlusterFS Command Executed: \n %s \n", cmd_str);
ret = gf_system (cmd_str);
@@ -1120,6 +1136,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
if (ret == 0) {
//pmap_registry_bind (THIS, port, brickinfo->path);
brickinfo->port = port;
+ brickinfo->rdma_port = rdma_port;
}
connect: