[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-grid5k] 30/48: add some comments to auditor.sh
From: |
gnunet |
Subject: |
[taler-grid5k] 30/48: add some comments to auditor.sh |
Date: |
Sat, 28 May 2022 12:11:50 +0200 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository grid5k.
commit cfaa7fc4d3c22782bff3ad96f40186224105ddf8
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Sat May 21 09:54:26 2022 +0200
add some comments to auditor.sh
---
additional/grafana/transactions.json | 3 ++-
experiment/scripts/auditor.sh | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/additional/grafana/transactions.json
b/additional/grafana/transactions.json
index e979449..a9f0d7e 100644
--- a/additional/grafana/transactions.json
+++ b/additional/grafana/transactions.json
@@ -1316,6 +1316,7 @@
}
},
"mappings": [],
+ "min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
@@ -2541,6 +2542,6 @@
"timezone": "",
"title": "Transactions",
"uid": "83vvgKKnk",
- "version": 165,
+ "version": 166,
"weekStart": ""
}
\ No newline at end of file
diff --git a/experiment/scripts/auditor.sh b/experiment/scripts/auditor.sh
index 4eeac9a..ca5f71a 100755
--- a/experiment/scripts/auditor.sh
+++ b/experiment/scripts/auditor.sh
@@ -11,14 +11,17 @@ init:
Configure and start the auditor together with its database
"
+# Prevent permission denied error messages when switching user
cd /tmp
+# Create the necessary users
function create_users() {
- for USER in auditor sync auditor-ingress auditor-wire; do
+ for USER in auditor auditor-ingress; do
adduser --quiet --home /tmp/${USER} ${USER} || true
done
}
+# initialize the auditor database
function init_db() {
# Grid5000 mounts the default disk on /tmp
@@ -187,6 +190,8 @@ createdb -O auditor "auditor"
EOF
}
+# Initialize the replicated database and enable replication once the
+# taler-exchange db is ready
function setup_exchange_replication() {
taler-config -s exchange -o DB -V "postgres"
@@ -205,8 +210,11 @@ function setup_exchange_replication() {
psql -d taler-ingress -U auditor-ingress -tAc 'GRANT ALL ON ALL TABLES IN
SCHEMA public TO auditor;'
EOF
+ # Wait for exchange db to be ready to accept connections
DB_USER=egress wait_for_db
+ # Complicated setup to be able to drop old and not working replication slots
+ # and create a new one
su postgres << EOF
psql -d taler-ingress -tAc "ALTER SUBSCRIPTION ${NODE_NAME} DISABLE;"
psql -d taler-ingress -tAc "ALTER SUBSCRIPTION ${NODE_NAME} SET
(slot_name=NONE);"
@@ -222,6 +230,8 @@ function enable_webservice() {
nginx
}
+# Setup the auditor configuration and configure the exchange to add this
auditor
+# Requires ssh access to the main exchange node
function setup_config() {
rm -rf /var/lib/taler/auditor/*
@@ -241,6 +251,8 @@ function setup_config() {
sudo -u auditor taler-auditor-dbinit
sudo -u auditor taler-auditor-exchange -m $(get_exchange_masterkey) -u
"https://${EXCHANGE_GW_DOMAIN}/"
+ # Connect to the main exchange node and add the auditor
+ # This is done from here because we may not have an auditor in some
experiments
ssh -o StrictHostKeyChecking=no ${PRIMARY_EXCHANGE} \
"/bin/bash ~/scripts/exchange.sh add-auditor '${PUB_KEY}'
'http://${NODE_NAME}.${DNS_ZONE}/' '${NODE_NAME}'"
@@ -248,14 +260,14 @@ function setup_config() {
taler-auditor-offline show < input.json
taler-auditor-offline sign < input.json > output.json
taler-auditor-offline upload < output.json
-
- setup_exchange_replication
}
+# Condifugre and start the auditor replication
function init_auditor() {
create_users
init_db
setup_config
+ setup_exchange_replication
}
case $1 in
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-grid5k] 40/48: not working, (continued)
- [taler-grid5k] 40/48: not working, gnunet, 2022/05/28
- [taler-grid5k] 27/48: different updates, gnunet, 2022/05/28
- [taler-grid5k] 29/48: nginx query params break loki, gnunet, 2022/05/28
- [taler-grid5k] 46/48: fix db dashboard, gnunet, 2022/05/28
- [taler-grid5k] 36/48: optimistically increase file limit, gnunet, 2022/05/28
- [taler-grid5k] 28/48: log query parameters in nginx, gnunet, 2022/05/28
- [taler-grid5k] 41/48: add wait events, gnunet, 2022/05/28
- [taler-grid5k] 26/48: fix setup.sh, gnunet, 2022/05/28
- [taler-grid5k] 39/48: add relabel to prometheus, gnunet, 2022/05/28
- [taler-grid5k] 31/48: fix update of g5k repo, gnunet, 2022/05/28
- [taler-grid5k] 30/48: add some comments to auditor.sh,
gnunet <=
- [taler-grid5k] 47/48: changes to rspec and dashboards, gnunet, 2022/05/28
- [taler-grid5k] 24/48: recover run.sh discard wget ouptup, gnunet, 2022/05/28
- [taler-grid5k] 34/48: increase bank size, gnunet, 2022/05/28
- [taler-grid5k] 44/48: added new panels for db statistics, gnunet, 2022/05/28
- [taler-grid5k] 32/48: update bank, gnunet, 2022/05/28
- [taler-grid5k] 43/48: fix metric, gnunet, 2022/05/28
- [taler-grid5k] 42/48: fix metric, gnunet, 2022/05/28