summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2013-10-25 09:05:18 -0400
committerVijay Bellur <vbellur@redhat.com>2013-11-06 03:06:40 -0800
commit7c433629c35f729241423dacdff1e297731153fc (patch)
tree6d7ac71510fa62621a7485e831a03090c54fbfff /xlators/mgmt/glusterd/src/glusterd.c
parent31ce9bad07414764572d07ab8e69a34c9c57475d (diff)
mgmt/glusterd: add option to specify a different base-port
This is (arguably) a hack to work around a bug in libvirt which is not well behaved wrt to using TCP ports in the unreserved space between 49152-65535. (See RFC 6335) Normally glusterd starts and binds to the first available port in range, usually 49152. libvirt's live migration also tries to use ports in this range, but has no fallback to use (an)other port(s) when the one it wants is already in use. libvirt cannot fix this in time for their impending release. This is submitted to gerrit to provide some minimal visibility upstream to justify hacking this change (as a temporary patch) into the glusterfs-3.4.1 RPMs for Fedora 18-21 until libvirt can fix their implementation. Change-Id: Ie77b00ac60730d1e48907dd0b38ddae92f3ac345 BUG: 987555 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/6147 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavan Pichai <rpichai@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 785e67af66d..62c4a578555 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -916,7 +916,6 @@ init (xlator_t *this)
int first_time = 0;
char *mountbroker_root = NULL;
int i = 0;
-
#ifdef DEBUG
char *valgrind_str = NULL;
#endif
@@ -1101,6 +1100,12 @@ init (xlator_t *this)
if (ret)
goto out;
+ conf->base_port = GF_IANA_PRIV_PORTS_START;
+ if (dict_get_uint32(this->options, "base-port", &conf->base_port) == 0) {
+ gf_log (this->name, GF_LOG_INFO,
+ "base-port override: %d", conf->base_port);
+ }
+
/* Set option to run bricks on valgrind if enabled in glusterd.vol */
#ifdef DEBUG
conf->valgrind = _gf_false;
@@ -1116,7 +1121,6 @@ init (xlator_t *this)
}
}
#endif
-
this->private = conf;
(void) glusterd_nodesvc_set_online_status ("glustershd", _gf_false);
@@ -1309,5 +1313,9 @@ struct volume_options options[] = {
.description = "Sets the quorum percentage for the trusted "
"storage pool."
},
+ { .key = {"base-port"},
+ .type = GF_OPTION_TYPE_INT,
+ .description = "Sets the base port for portmap query"
+ },
{ .key = {NULL} },
};