diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-08-10 18:31:55 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-08-17 04:02:20 +0000 |
commit | 3998c28324c8907b9b3ade75c98a6a0e4591f23b (patch) | |
tree | 0f8dd704dabdac15c03fcc383f44171c167ae807 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 204d52a4b6c13d16132f67ee94f823fa23c11538 (diff) |
glusterd: introduce max-port range
glusterd.vol file always had an option (commented out) to indicate the
base-port to start the portmapper allocation. This patch brings in the
max-port configuration where one can limit the range of ports which
gluster can be allowed to bind.
Fixes: #305
Change-Id: Id7a864f818227b9530a07e13d605138edacd9aa9
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/18016
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Gaurav Yadav <gyadav@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 9e98225e73e..dfdd795f186 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2002,7 +2002,14 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, } port = pmap_assign_port (THIS, brickinfo->port, brickinfo->path); - + if (!port) { + gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_PORTS_EXHAUSTED, + "All the ports in the range are exhausted, can't start " + "brick %s for volume %s", brickinfo->path, + volinfo->volname); + ret = -1; + goto out; + } /* Build the exp_path, before starting the glusterfsd even in valgrind mode. Otherwise all the glusterfsd processes start writing the valgrind log to the same file. @@ -2077,6 +2084,15 @@ retry: brickinfo->path); rdma_port = pmap_assign_port (THIS, brickinfo->rdma_port, rdma_brick_path); + if (!rdma_port) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_PORTS_EXHAUSTED, "All rdma ports in the " + "range are exhausted, can't start brick %s for " + "volume %s", rdma_brick_path, + volinfo->volname); + ret = -1; + goto out; + } runner_argprintf (&runner, "%d,%d", port, rdma_port); runner_add_arg (&runner, "--xlator-option"); runner_argprintf (&runner, "%s-server.transport.rdma.listen-port=%d", |