summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts/ganesha-ha.sh
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-09-02 17:15:23 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-03-14 21:25:32 -0700
commit5154e581ae3424890533bcd71e61e0a6f4a5aa08 (patch)
tree87b5c5beb0bb8c50579eef37aaff52f40c9984b1 /extras/ganesha/scripts/ganesha-ha.sh
parentdd1201e01f7f3cd86992f57f9b46f476bdb43d8c (diff)
CommonHA: Avoid scp of the config state to the same host
During add-node, have seen an issue where in scp doesn't work if the source and destination host are same. Fixed the same. BUG: 1259225 Change-Id: Ib8fe21b3c95d653c62698310d5390b46a3c6bbf4 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/12091 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-on: http://review.gluster.org/13720 Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras/ganesha/scripts/ganesha-ha.sh')
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index cb4c5424428..901464e0ef8 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -315,14 +315,27 @@ copy_export_config ()
local short_host=$(hostname -s)
# avoid prompting for password, even with password-less scp
# scp $host1:$file $host2:$file prompts for the password
- scp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
+ # Ideally all the existing nodes in the cluster should have same
+ # copy of the configuration files. Maybe for sanity check, copy
+ # the state from HA_VOL_SERVER?
+ if [ "${HA_VOL_SERVER}" == $(hostname) ]
+ then
+ cp ${GANESHA_CONF} ${tganesha_conf}
+ else
+ scp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
${SECRET_PEM} ${HA_VOL_SERVER}:${GANESHA_CONF} $short_host:${tganesha_conf}
+ fi
scp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
${SECRET_PEM} ${tganesha_conf} ${new_node}:${GANESHA_CONF}
rm -f ${tganesha_conf}
- scp -r -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
+ if [ "${HA_VOL_SERVER}" == $(hostname) ]
+ then
+ cp -r ${HA_CONFDIR}/exports ${tganesha_exports}
+ else
+ scp -r -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
${SECRET_PEM} ${HA_VOL_SERVER}:${HA_CONFDIR}/exports/ $short_host:${tganesha_exports}
+ fi
scp -r -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
${SECRET_PEM} ${tganesha_exports}/exports ${new_node}:${HA_CONFDIR}/
rm -rf ${tganesha_exports}