gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 55/73: db disk mount


From: gnunet
Subject: [taler-grid5k] 55/73: db disk mount
Date: Tue, 14 Dec 2021 15:10:37 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit d8cabd2cf5e5ee8663cac73400697fc3b66a29d6
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Wed Dec 8 15:00:36 2021 +0100

    db disk mount
---
 experiment/scripts/database.sh | 13 +++++++++++++
 experiment/scripts/monitor.sh  | 10 +++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 8f83a8f..76ebd43 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -6,6 +6,18 @@ source ~/scripts/helpers.sh
 # move to tmp to prevent change dir errors
 cd /tmp 
 
+function setup_disks() {
+  if [[ "$(hostname)" =~ "dahu" ]]; then
+    mkdir /mnt/sdb || true
+    mount /dev/sdb /mnt/sdb || true
+    if [ ! -L /var/lib/postgresql/13/main/pg_wal ]; then
+      mv /var/lib/postgresql/13/main/pg_wal/ /mnt/sdb
+      ln -s /mnt/sdb/pg_wal /var/lib/postgresql/13/main/pg_wal
+      chown -R postgres:postgres /var/lib/postgresql/13/main/pg_wal/
+    fi
+  fi
+}
+
 function setup_config() {
   sed -i "s\<DB_URL_HERE>\postgresql:///${DB_NAME}\g" \
        /etc/taler/secrets/exchange-db.secret.conf
@@ -90,6 +102,7 @@ function setup_config() {
 
 if [[ "$1" == "init" ]]; then
   setup_config
+  setup_disks
 fi
 
 systemctl restart postgresql
diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh
index 7e779c9..90f9fcf 100755
--- a/experiment/scripts/monitor.sh
+++ b/experiment/scripts/monitor.sh
@@ -68,7 +68,7 @@ function add_wallet_nodes_to_prometheus() {
   fi
 }
 
-function add_exchange_nodes_to_prometheus() {
+function add_exchanges_to_prometheus() {
   if [[ "$1" == "init" ]]; then 
     cat /etc/monitor/exchange-exporters.yaml.tpl >> 
/etc/monitor/prometheus.yaml
   fi
@@ -93,11 +93,14 @@ function init() {
   
   wait_for_db
   
-  add_wallet_nodes_to_prometheus "init"
-  
   # Proxy takes longer to start
   wait_for_keys "${PROXY_DOMAIN}"
   
+  # Wait that the nginx proxy has the exchanges configured
+  sleep 1
+  add_wallet_nodes_to_prometheus "init"
+  add_exchanges_to_prometheus "init"
+
   systemctl restart prometheus-nginx-exporter \
                     prometheus-postgres-exporter 
 
@@ -107,6 +110,7 @@ if [[ "$1" == "init" ]]; then
   init
 else 
   add_wallet_nodes_to_prometheus ""
+  add_exchanges_to_prometheus ""
 fi
 
 systemctl restart prometheus

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]