summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-10-21 09:20:31 +0200
committerNiels de Vos <ndevos@redhat.com>2014-10-21 08:38:50 -0700
commit4f58e62ce5787303ced4e11ba15d5ce8f07c379f (patch)
tree2afe2f8a213bfdf6cae4ae7186316083f9451401 /xlators/mgmt/glusterd
parent6b6ee3bce4b2fcb2cbfd06ab0a199d7aac4b7cec (diff)
glusterd: pass the bind-address to starting services
When the transport.socket.bind-address option is set to a hostname or ip-address, the services started by GlusterD fail to connect to the management daemon. GlusterD always forces the services to connect to the "localhost" hostname, even if it is not listening on that address. GlusterD should take the transport.socket.bind-address option into consideration, and pass that to the glusterfs-clients with the -s or --volfile commandline parameter. Note that this is not a change that removes all hard-coded dependencies on "localhost". This change merely makes it possible to start required services when the transport.socket.bind-address option is set. Cherry picked from commit 283fa797f4bf98130b42c36972305b8cb6e5aaaf: > Change-Id: I36a0ed6c69342e6327adc258fea023929055d7f2 > BUG: 1149863 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/8908 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> > Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> > Tested-by: Krishnan Parthasarathi <kparthas@redhat.com> Change-Id: I36a0ed6c69342e6327adc258fea023929055d7f2 BUG: 1149857 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8952 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 0aa8e5db0e8..87d08182083 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3985,7 +3985,8 @@ glusterd_nodesvc_start (char *server, gf_boolean_t wait)
char logfile[PATH_MAX] = {0,};
char volfile[PATH_MAX] = {0,};
char rundir[PATH_MAX] = {0,};
- char sockfpath[PATH_MAX] = {0,};
+ char sockfpath[PATH_MAX] = {0,};
+ char *volfileserver = NULL;
char volfileid[256] = {0};
char glusterd_uuid_option[1024] = {0};
char valgrind_logfile[PATH_MAX] = {0};
@@ -4020,6 +4021,11 @@ glusterd_nodesvc_start (char *server, gf_boolean_t wait)
server);
snprintf (volfileid, sizeof (volfileid), "gluster/%s", server);
+ if (dict_get_str (this->options, "transport.socket.bind-address",
+ &volfileserver) != 0) {
+ volfileserver = "localhost";
+ }
+
glusterd_nodesvc_set_socket_filepath (rundir, MY_UUID,
sockfpath, sizeof (sockfpath));
@@ -4041,7 +4047,7 @@ glusterd_nodesvc_start (char *server, gf_boolean_t wait)
}
runner_add_args (&runner, SBIN_DIR"/glusterfs",
- "-s", "localhost",
+ "-s", volfileserver,
"--volfile-id", volfileid,
"-p", pidfile,
"-l", logfile,