From 5757ed2727990fd2c3aaff420003638f1eec6b92 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 10 Jul 2013 17:32:41 +0530 Subject: glusterd/cli changes for distributed geo-rep Commands: gluster system:: execute gsec_create gluster volume geo-rep create [push-pem] [force] gluster volume geo-rep start [force] gluster volume geo-rep stop [force] gluster volume geo-rep delete gluster volume geo-rep config gluster volume geo-rep status The geo-replication is distributed. The session will be created, and gsyncd will be spawned on all relevant nodes, instead of only one node. geo-rep: Collecting status detail related data Added persistent store for saving information about TotalFilesSynced, TotalSyncTime, TotalBytesSynced Changes in the status information in socket: Existing(Ex): FilesSynced=2;BytesSynced=2507;Uptime=00:26:01; New(Ex): FilesSynced=2;BytesSynced=2507;Uptime=00:26:01;SyncTime=0.69978; TotalSyncTime=2.890044;TotalFilesSynced=6;TotalBytesSynced=143640; Persistent details stored in /var/lib/glusterd/geo-replication/${mastervol}/${eSlave}-detail.status Change-Id: I1db7fc13ffca2e415c05200b0109b1254067f111 BUG: 847839 Original Author: Avra Sengupta Original Author: Venky Shankar Original Author: Aravinda VK Original Author: Amar Tumballi Original Author: Csaba Henk Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/5132 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- extras/hook-scripts/Makefile.am | 2 +- .../S56glusterd-geo-rep-create-post.sh | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 extras/hook-scripts/S56glusterd-geo-rep-create-post.sh (limited to 'extras') diff --git a/extras/hook-scripts/Makefile.am b/extras/hook-scripts/Makefile.am index edfa5a6ac87..f6bded20cbe 100644 --- a/extras/hook-scripts/Makefile.am +++ b/extras/hook-scripts/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = S29CTDBsetup.sh S30samba-start.sh S30samba-stop.sh S30samba-set.sh Sglusterd-geo-rep-create-post.sh +EXTRA_DIST = S29CTDBsetup.sh S30samba-start.sh S30samba-stop.sh S30samba-set.sh S56glusterd-geo-rep-create-post.sh diff --git a/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh new file mode 100755 index 00000000000..71e44b6ed13 --- /dev/null +++ b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +key_val_pair1=`echo $2 | cut -d ' ' -f 1` +key_val_pair2=`echo $2 | cut -d ' ' -f 2` +key_val_pair3=`echo $2 | cut -d ' ' -f 3` + +key=`echo $key_val_pair1 | cut -d '=' -f 1` +val=`echo $key_val_pair1 | cut -d '=' -f 2` +if [ "$key" != "is_push_pem" ]; then + exit; +fi +if [ "$val" != '1' ]; then + exit; +fi + +key=`echo $key_val_pair2 | cut -d '=' -f 1` +val=`echo $key_val_pair2 | cut -d '=' -f 2` +if [ "$key" != "pub_file" ]; then + exit; +fi +if [ "$val" == "" ]; then + exit; +fi +pub_file=`echo $val` + +key=`echo $key_val_pair3 | cut -d '=' -f 1` +val=`echo $key_val_pair3 | cut -d '=' -f 2` +if [ "$key" != "slave_ip" ]; then + exit; +fi +if [ "$val" == "" ]; then + exit; +fi +slave_ip=`echo $val` + +if [ -f $pub_file ]; then + ssh $slave_ip "\rm -rf $pub_file" + scp $pub_file $slave_ip:$pub_file &> /dev/null + ssh $slave_ip "gluster system:: copy file /geo-replication/common_secret.pem.pub > /dev/null" + ssh $slave_ip "gluster system:: execute add_secret_pub > /dev/null" +fi -- cgit