summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-04-23 17:37:01 +0200
committerMagnus Ahltorp <map@kth.se>2015-04-23 17:37:01 +0200
commit8c27bafa7f722ddc17d535d3d0fb0758cb532171 (patch)
treeb813acf102b70830396716c428d912e39983273a /tools
parent2bd043cb386e3b0fcab28ca2b27e9be21450a72c (diff)
Add remote script for merge secondary
Diffstat (limited to 'tools')
-rwxr-xr-xtools/merge.py9
-rwxr-xr-xtools/verifysecondary.sh4
2 files changed, 10 insertions, 3 deletions
diff --git a/tools/merge.py b/tools/merge.py
index ed1c162..b426039 100755
--- a/tools/merge.py
+++ b/tools/merge.py
@@ -38,7 +38,7 @@ localconfig = yaml.load(open(args.localconfig))
ctbaseurl = config["baseurl"]
frontendnodes = config["frontendnodes"]
storagenodes = config["storagenodes"]
-secondaries = localconfig["secondary"]
+secondaries = localconfig.get("secondary", [])
paths = localconfig["paths"]
mergedb = paths["mergedb"]
@@ -241,15 +241,18 @@ timestamp = int(time.time() * 1000)
for secondary in secondaries:
remotehost = secondary["host"]
remotedir = remotehost + ":" + secondary["mergedir"]
+ localdir = mergedb
+ if localdir[:-1] != '/':
+ localdir = localdir + "/"
print >>sys.stderr, "copying database to secondary:", remotehost
- rsyncstatus = subprocess.call(["rsync", "-r", "--append", "--rsh=ssh", mergedb, remotedir])
+ rsyncstatus = subprocess.call(["rsync", "-r", "--append", "--rsh=ssh", localdir, remotedir])
if rsyncstatus:
print >>sys.stderr, "rsync failed:", rsyncstatus
sys.exit(1)
print >>sys.stderr, "verifying database at secondary:", remotehost
- verifysecondary = subprocess.Popen(["ssh", remotehost, secondary["verifycommand"]],
+ verifysecondary = subprocess.Popen(["ssh", remotehost, secondary["verifycommand"], secondary["mergedir"]],
stdout=subprocess.PIPE)
(verifysecondaryresult, _) = verifysecondary.communicate()
diff --git a/tools/verifysecondary.sh b/tools/verifysecondary.sh
new file mode 100755
index 0000000..4a90543
--- /dev/null
+++ b/tools/verifysecondary.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd $(dirname $0)/../catlfish
+../tools/verifysecondary.py --mergedb="$1" --verifycert=../verifycert.erl --knownroots=../tools/testcerts/roots/