diff options
author | Anand V. Avati <avati@blackhole.gluster.com> | 2010-08-12 05:05:01 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-12 03:55:12 -0700 |
commit | b69a4f1e31726260a07f883cefac28ed29cc6a12 (patch) | |
tree | 864d706e8f4d02d6b3296665f74e110020a03d4c /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | f862864468c9d11d646bdcc347a1121fe75a1917 (diff) |
portmap functionality in glusterd
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1314 (portmapper functionality)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1314
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c17582341c0..c135e75264f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -716,7 +716,7 @@ glusterd_volinfo_find (char *volname, glusterd_volinfo_t **volinfo) int32_t glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, - glusterd_brickinfo_t *brickinfo, + glusterd_brickinfo_t *brickinfo, int32_t count) { int32_t ret = -1; @@ -727,6 +727,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, char path[PATH_MAX] = {0,}; char cmd_str[8192] = {0,}; char rundir[PATH_MAX] = {0,}; + int port = 0; GF_ASSERT (volinfo); GF_ASSERT (brickinfo); @@ -746,12 +747,19 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, goto out; } + port = pmap_registry_alloc (THIS); + GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname, count); snprintf (volfile, PATH_MAX, "%s/%s-%s-%d.vol", path, brickinfo->hostname, volinfo->volname, count); - snprintf (cmd_str, 8192, "glusterfs -f %s -p %s", volfile, pidfile); + + snprintf (cmd_str, 8192, + "glusterfs --xlator-option server-tcp.listen-port=%d -f %s -p %s", + port, volfile, pidfile); ret = system (cmd_str); + if (ret == 0) + pmap_registry_bind (THIS, port, brickinfo->path); out: return ret; } |