File tree Expand file tree Collapse file tree 4 files changed +24
-24
lines changed Expand file tree Collapse file tree 4 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ This repo contains the service and cron scripts used to run a failover gocdb ins
28
28
|_ dropGocdbUser.sh # Drops the current DB schema
29
29
|_ loadData.sh # Load the last successfully downloaded DB dmp into the RDBMS
30
30
|_ gatherStats.sh # Oracle gathers stats to re-index
31
- |_ pass_wgetrc_exemplar.txt # Sample pwd file for getDump.sh (rename to pass_wgetrc)
32
31
|_ pass_file_exemplar.txt # Sample pwd file for DB (rename to pass_file)
33
32
34
33
nsupdate_goc/ # Scripts for switching the DNS to the failover
@@ -71,10 +70,11 @@ cron:
71
70
/root/importDBdmpFile/1_runDbUpdate.sh
72
71
```
73
72
74
- You will also need to modify the two password files to specify
75
- your own pw ('pass_wgetrc' and 'pass_file'). These contain the
76
- pw for the secure download of dmp file and the pw of the DB
77
- system user.
73
+ You will also need to:
74
+ * generate a public/private key pair using ` ssh-keygen ` and ensure the public
75
+ key is present on the host with the database dmp file.
76
+ * populate ` importDBdmpFile/failover_TEMPLATE.sh ` with
77
+ appropriate values and copy it to ` /etc/gocdb/failover.sh `
78
78
79
79
## /root/nsupdate_goc/
80
80
Contains the nsupdate keys and nsupdate scripts for switching
Original file line number Diff line number Diff line change
1
+ # This file is a template for /etc/gocdb/failover.sh.
2
+ # Copy this file to that location and set the variables as appropriate.
3
+
4
+ # Set the user@host:path to copy the DB dump file from.
5
+ DB_DUMP_FROM=user@hostname:/path/to/db/dump
6
+
7
+ # Set the local location to copy the DB dump file to.
8
+ DB_DUMP_TO=/tmp
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # seems that curl don't return a 0 exit code when it fails to download successfully, see:
4
- # http://superuser.com/questions/590099/can-i-make-curl-fail-with-an-exitcode-different-than-0-if-the-http-status-code-i
5
- #
6
- # curl --capath /etc/grid-security/certificates -u failover:kugA7Rer https://goc.egi.eu/dbDump/goc5dump.dmp -o /tmp/goc5dump.dmp
3
+ # Set some things that cause this script to exit on a failure,
4
+ # rather than carry on blindly.
5
+ # -e Exit on any error
6
+ # -u Classify unset variables as errors
7
+ set -eu
7
8
8
- # therefore use wget which does return 0 exit code if downloaded ok
9
- # /usr/bin/wget -O /tmp/goc5dump.dmp --user failover --password u_LK28_B2fv_dm --no-check-certificate https://goc.egi.eu/dbDump/goc5dump.dmp
9
+ # Get useful variables to refer to later in this script.
10
+ source /etc/gocdb/ failover.sh
10
11
11
- DUMPDIR=/tmp
12
- BASEDIR=/root/importDBdmpFile
12
+ # Copy the DB dump file.
13
+ /usr/bin/scp $DB_DUMP_FROM $DB_DUMP_TO
13
14
14
- export WGETRC=$BASEDIR /pass_wgetrc
15
-
16
- /usr/bin/wget --no-check-certificate \
17
- --ca-directory /etc/grid-security/certificates \
18
- -O $DUMPDIR /goc5dump.dmp \
19
- https://goc.egi.eu/dbDump/goc5dump.dmp
15
+ # unset things to not affect the rest of the Failover process.
16
+ set +eu
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments