diff options
| author | Soumya Koduri <skoduri@redhat.com> | 2015-09-02 17:15:23 +0530 | 
|---|---|---|
| committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-09-02 17:31:35 -0700 | 
| commit | 07b31a008b59d6c0b06bd17994de85fc56560b38 (patch) | |
| tree | 4a1d71f9a795979407b0bea5b4a7248dc45c09d9 /extras | |
| parent | 9f27ef94827e5b73276887011153633291549cda (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.
Change-Id: I33fc18ff39e54ced277f94afef7a11a22c9ccce0
BUG: 1259225
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>
Diffstat (limited to 'extras')
| -rw-r--r-- | extras/ganesha/scripts/ganesha-ha.sh | 17 | 
1 files changed, 15 insertions, 2 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh index 1356a385573..72465be32aa 100644 --- a/extras/ganesha/scripts/ganesha-ha.sh +++ b/extras/ganesha/scripts/ganesha-ha.sh @@ -316,14 +316,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}  | 
