From e3b217155b489fc1d6fd29c221a986b894f391db Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 18 Jan 2018 22:59:00 -0500 Subject: geo-rep: Improve geo-rep pre-validation logs Geo-rep runs gverify.sh which does pre-validation. As part of it, master and slave volume is mounted to verify the size. If for some reason, the mount fails, the error message does not point out the mount log file location. Also both master and slave mount logs are same. Patch does following improvements. 1. Master and slave mount logs are separated and error message points the log file to be looked for. 2. The log location is changed to /var/log/glusterfs/geo-replication instead of /var/log/glusterfs/geo-replication-slaves 3. The log file name is changed to "gverify-mastermnt.log" and "gverify-slavemnt.log" for master and slave mount respectively Fixes: #395 Change-Id: Ia644ec0afebbdaae92e01adf03c635e5f8866a02 Signed-off-by: Kotresh HR --- geo-replication/src/gverify.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh index 7440f44c02..d048de0992 100755 --- a/geo-replication/src/gverify.sh +++ b/geo-replication/src/gverify.sh @@ -7,7 +7,8 @@ # Considering buffer_size 100MB BUFFER_SIZE=104857600; SSH_PORT=$5; -slave_log_file=`gluster --print-logdir`/geo-replication-slaves/slave.log +master_log_file=`gluster --print-logdir`/geo-replication/gverify-mastermnt.log +slave_log_file=`gluster --print-logdir`/geo-replication/gverify-slavemnt.log function SSHM() { @@ -101,7 +102,7 @@ function master_stats() local m_status; d=$(mktemp -d -t ${0##*/}.XXXXXX 2>/dev/null); - glusterfs -s localhost --xlator-option="*dht.lookup-unhashed=off" --volfile-id $MASTERVOL -l $slave_log_file $d; + glusterfs -s localhost --xlator-option="*dht.lookup-unhashed=off" --volfile-id $MASTERVOL -l $master_log_file $d; i=$(get_inode_num $d); if [[ "$i" -ne "1" ]]; then echo 0:0; @@ -214,12 +215,12 @@ function main() slave_no_of_files=$(echo $slave_data | cut -f4 -d':'); if [[ "x$master_disk_size" = "x" || "x$master_version" = "x" || "$master_disk_size" -eq "0" ]]; then - echo "FORCE_BLOCKER|Unable to fetch master volume details. Please check the master cluster and master volume." > $log_file; + echo "FORCE_BLOCKER|Unable to mount and fetch master volume details. Please check the log: $master_log_file" > $log_file; exit 1; fi; if [[ "x$slave_disk_size" = "x" || "x$slave_version" = "x" || "$slave_disk_size" -eq "0" ]]; then - echo "FORCE_BLOCKER|Unable to fetch slave volume details. Please check the slave cluster and slave volume." > $log_file; + echo "FORCE_BLOCKER|Unable to mount and fetch slave volume details. Please check the log: $slave_log_file" > $log_file; exit 1; fi; -- cgit