summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-10-21 09:05:43 +0200
committerVijay Bellur <vbellur@redhat.com>2014-10-21 10:15:58 -0700
commitd32bc8aa365dbb804af8c8ff18eecbf349eba9e8 (patch)
treec6bb08314372ee10ba801cae09a34e373d9d7557
parent8e598bb02ae431cc08e7bfe449fede21e0ed2f35 (diff)
glusterd: make bricks respect 'transport.socket.bind-address'
When GlusterD starts the brick processes, these will listen on all interfaces. When the 'transport.socket.bind-address' option is set in glusterd.vol, the brick processes should only listen on the specified hostname or IP-address. Cherry picked from commit 430b874c4f1a171c106a9e1e6507e14e79805a1d: > Change-Id: I8e7d1f294904081137c23f3446261329d0d13bba > BUG: 1149863 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/8910 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> > Tested-by: Krishnan Parthasarathi <kparthas@redhat.com> Change-Id: I8e7d1f294904081137c23f3446261329d0d13bba BUG: 1151745 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8951 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index e250da9700a..020187cc6e3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1833,6 +1833,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
char logfile[PATH_MAX] = {0,};
int port = 0;
int rdma_port = 0;
+ char *bind_address = NULL;
char socketpath[PATH_MAX] = {0};
char glusterd_uuid[1024] = {0,};
char valgrind_logfile[PATH_MAX] = {0};
@@ -1945,6 +1946,13 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
runner_argprintf (&runner, "%s-server.listen-port=%d",
volinfo->volname, port);
+ if (dict_get_str (this->options, "transport.socket.bind-address",
+ &bind_address) == 0) {
+ runner_add_arg (&runner, "--xlator-option");
+ runner_argprintf (&runner, "transport.socket.bind-address=%s",
+ bind_address);
+ }
+
if (volinfo->memory_accounting)
runner_add_arg (&runner, "--mem-accounting");