From 76726da0e86077a8f3a59c02a47fcf2e3994218f Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Tue, 12 Jul 2016 15:44:23 +0530 Subject: glusterd/ganesha : Move ganesha-ha.conf and ganesha.conf to shared storage Currently all the ganesha related configuration files(ganesha.conf, ganesha-ha.conf, export files, etc) is stored locally at /etc/ganesha on a every node in ganesha cluster. Usually we end up in two issues by doing so : * difficult in modifiying ganesha related conf file * diffciult to maintain consistency of conf file across ganesha cluster To tackle this, we plan to move all the ganesha configuration to shared storage. As a first step in this patch ganesha.conf and ganesha-ha.conf move to shared storage. Here actual ganesha.conf will resides in shared stoarge and symlinks will be created in /etc/ganesha when the option "gluster nfs-ganesha enable" is executed and remove those during the "disable" part. Modified prerequisites to done before running globaloption: * enable shared storage * create nfs-ganesha folder in shared storage * create ganesha.conf and ganesha-ha.conf in it More details can be found at http://review.gluster.org/#/c/15105/ Change-Id: Ifabb6c5db50061f077a03932940190af74e2ca7f BUG: 1355956 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/14906 Reviewed-by: soumya k NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Reviewed-by: Kaleb KEITHLEY CentOS-regression: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index a0904fb9634..bae9be872f4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1421,10 +1421,14 @@ glusterd_op_stage_reset_volume (dict_t *dict, char **op_errstr) char *key_fixed = NULL; glusterd_volinfo_t *volinfo = NULL; xlator_t *this = NULL; + glusterd_conf_t *priv = NULL; this = THIS; GF_ASSERT (this); + priv = this->private; + GF_ASSERT (priv); + ret = dict_get_str (dict, "volname", &volname); if (ret) { @@ -1451,6 +1455,16 @@ glusterd_op_stage_reset_volume (dict_t *dict, char **op_errstr) ret = glusterd_validate_volume_id (dict, volinfo); if (ret) goto out; + ret = dict_get_str_boolean (priv->opts, + GLUSTERD_STORE_KEY_GANESHA_GLOBAL, _gf_false); + if (ret) { + ret = stop_ganesha (op_errstr); + if (ret) + gf_msg (THIS->name, GF_LOG_WARNING, 0, + GD_MSG_NFS_GNS_STOP_FAIL, + "Could not stop NFS-Ganesha service"); + } + } ret = dict_get_str (dict, "key", &key); @@ -2037,11 +2051,6 @@ glusterd_op_reset_all_volume_options (xlator_t *this, dict_t *dict) gf_msg (THIS->name, GF_LOG_WARNING, errno, GD_MSG_DICT_GET_FAILED, "Could not tear down NFS-Ganesha cluster"); - ret = stop_ganesha (&op_errstr); - if (ret) - gf_msg (THIS->name, GF_LOG_WARNING, 0, - GD_MSG_NFS_GNS_STOP_FAIL, - "Could not stop NFS-Ganesha service"); } ret = -1; -- cgit