gnunet-svn
[Top][All Lists]
Advanced

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

[taler-grid5k] 28/189: fixes


From: gnunet
Subject: [taler-grid5k] 28/189: fixes
Date: Thu, 28 Apr 2022 10:46:38 +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 b8b9075a8e180f36c61ee368ffd0cc7247987e73
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Wed Feb 23 20:04:21 2022 +0100

    fixes
---
 experiment/scripts/database.sh | 25 +++++++++++++------------
 experiment/scripts/dns.sh      |  4 ++--
 experiment/scripts/helpers.sh  |  2 +-
 experiment/scripts/monitor.sh  |  6 +++---
 experiment/scripts/shard.sh    | 16 ++++++++--------
 5 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 4113935..57d8db6 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -14,16 +14,17 @@ source ~/scripts/helpers.sh
 cd /tmp 
 
 function setup_disks() {
-  test -c /dev/disk1 || ( echo "No second disk for WAL available"; return )
-  echo 'start=2048, type=83' | sfdisk /dev/disk1 || true
-  yes | mkfs.ext4 -m 0 /dev/disk1 || true
-  mkdir /mnt/disk || true
-  mount /dev/disk1 /mnt/disk || true
-  if [ ! -L /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal ]; then
-    rm -rf /mnt/disk/pg_wal || true
-    mv /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal/ /mnt/disk
-    ln -s /mnt/disk/pg_wal /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal
-    chown -R postgres:postgres 
/var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal
+  if [ -c /dev/disk1 ]; then
+    echo 'start=2048, type=83' | sfdisk /dev/disk1 || true
+    yes | mkfs.ext4 -m 0 /dev/disk1 || true
+    mkdir /mnt/disk || true
+    mount /dev/disk1 /mnt/disk || true
+    if [ ! -L /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal ]; then
+      rm -rf /mnt/disk/pg_wal || true
+      mv /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal/ /mnt/disk
+      ln -s /mnt/disk/pg_wal 
/var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal
+      chown -R postgres:postgres 
/var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal
+    fi
   fi
 }
 
@@ -212,10 +213,10 @@ psql -d "${DB_NAME}" -tAc "SELECT 
create_shard_server('${SHARD_DOMAIN//\*/${SHAR
                                                       ${i},
                                                       '${DB_NAME}');"
 psql -d "${DB_NAME}" -tAc "GRANT ALL PRIVILEGES ON
-                           FOREIGN SERVER \"shard_${SHARD_NAME}\"
+                           FOREIGN SERVER \"shard_${SHARD}\"
                            TO \"taler-exchange-httpd\";"
 psql -d "${DB_NAME}" -tAc "CREATE USER MAPPING IF NOT EXISTS FOR \"${DB_USER}\"
-                           SERVER \"shard_${SHARD_NAME}\"
+                           SERVER \"shard_${SHARD}\"
                            OPTIONS (user '${DB_USER}', password 
'${DB_PASSWORD}');"
 EOF
   let "i=i+1"
diff --git a/experiment/scripts/dns.sh b/experiment/scripts/dns.sh
index 7c6706a..7e9f711 100644
--- a/experiment/scripts/dns.sh
+++ b/experiment/scripts/dns.sh
@@ -7,8 +7,8 @@ cp ~/nodes.json ${LOG_DIR}/nodes.json
 # Clean the file so it is cleanly updated in each run
 rm ${LOG_DIR}/commits.txt || true
 
-for DIR in $(ls ~/taler); do
-  cd ~/taler/${DIR}
+for DIR in $(find ~/taler -type d -maxdepth 1); do
+  cd ${DIR}
   echo "${DIR}: $(git rev-parse HEAD)" >> ${LOG_DIR}/commits.txt
   cd -
 done
diff --git a/experiment/scripts/helpers.sh b/experiment/scripts/helpers.sh
index a7238c3..d6c3280 100755
--- a/experiment/scripts/helpers.sh
+++ b/experiment/scripts/helpers.sh
@@ -152,7 +152,7 @@ function get_wallet_hosts() {
 function get_shard_hosts() {
   IFS=$'\n' read -r -d '' -a SHARDS < <(\
     dig -t AXFR "${DNS_ZONE}" "@${DNS_HOSTS}" \
-    | grep ${SHARD_DOMAIN} | awk '{print $2}' | cut -d '.' -f 2 \
+    | grep ${SHARD_DOMAIN} | awk '{print $1}' | cut -d '.' -f 2 \
   )
   echo ${SHARDS[@]}
 }
diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh
index 24f24d2..2435da1 100755
--- a/experiment/scripts/monitor.sh
+++ b/experiment/scripts/monitor.sh
@@ -67,10 +67,10 @@ function configure_prometheus_and_exporters() {
          -e 
"s\<MERCHANT_DB_URL_HERE>\postgresql://postgres@${MERCHANT_DOMAIN}:5432\g" \
              /etc/default/prometheus-postgres-exporter
 
-  CFG=","
+  CFG=""
   for SHARD in $(get_shard_hosts); do
-    CFG="${CFG}postgresql://postgres@${SHARD_DOMAIN//\*/${SHARD}}:5432"
-  fi
+    CFG="${CFG},postgresql://postgres@${SHARD_DOMAIN//\*/${SHARD}}:5432"
+  done
   sed -i "s|<SHARD_DB_URLS_HERE>|${CFG}|g" \
           /etc/default/prometheus-postgres-exporter
   
diff --git a/experiment/scripts/shard.sh b/experiment/scripts/shard.sh
index 8c87bb0..f2f2b7b 100755
--- a/experiment/scripts/shard.sh
+++ b/experiment/scripts/shard.sh
@@ -120,15 +120,15 @@ EOF
   chmod o+r /tmp/exchange-shard-0000.sql
 
   PGPASSWORD=${DB_PASSWORD} psql -tA \
-                                -U ${DB_USER} \
-                                -h localhost \
-                                -d ${DB_NAME} \
-                                -f /tmp/exchange-shard-0000.sql
+                                 -U ${DB_USER} \
+                                 -h localhost \
+                                 -d ${DB_NAME} \
+                                 -f /tmp/exchange-shard-0000.sql
   PGPASSWORD=${DB_PASSWORD} psql -tA \
-                                -U ${DB_USER} \
-                                -h localhost \
-                                -d ${DB_NAME} \
-                                -c "SELECT setup_shard_tables('$(hostname | 
cut -d "." -f 1)');"
+                                 -U ${DB_USER} \
+                                 -h localhost \
+                                 -d ${DB_NAME} \
+                                 -c "SELECT setup_shard_tables('$(hostname | 
cut -d "." -f 1)');"
   
 }
 

-- 
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]