diff options
Diffstat (limited to 'experiment')
-rw-r--r-- | experiment/env | 3 | ||||
-rw-r--r-- | experiment/scripts/auditor.sh | 7 | ||||
-rwxr-xr-x | experiment/scripts/database.sh | 8 | ||||
-rwxr-xr-x | experiment/scripts/monitor.sh | 4 |
4 files changed, 19 insertions, 3 deletions
diff --git a/experiment/env b/experiment/env index 82eb443..017ae33 100644 --- a/experiment/env +++ b/experiment/env @@ -133,6 +133,9 @@ NUM_AGGREGATOR_PROCESSES=0 NUM_TRANSER_PROCESSES=1 NUM_WIREWATTCH_PROCESSES=1 +# If the auditor should be setup or not when the node is added in the rspec +TALER_SETUP_AUDITOR_REPLICATION=0 + # If prometheus node exporter should be enabled # Most certainly this is true, since otherwise no overview # of services and running wallets can be generated in grafana. diff --git a/experiment/scripts/auditor.sh b/experiment/scripts/auditor.sh index 8b2ce43..f8a9972 100644 --- a/experiment/scripts/auditor.sh +++ b/experiment/scripts/auditor.sh @@ -23,6 +23,9 @@ function init_db() { echo " listen_addresses='*' wal_level = logical + min_wal_size = 20GB + max_wal_size = 200GB + synchronous_commit=off " > /etc/postgresql/${POSTGRES_VERSION}/main/auditor.conf echo " @@ -123,6 +126,10 @@ function init_auditor() { case $1 in init) + if [[ "${TALER_SETUP_AUDITOR_REPLICATION}" == "0" ]]; then + echo "Not setting up auditor" + exit 0 + fi if [[ "${PARTITION_DB}" == "true" ]]; then init_auditor else diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh index 8a22bb7..3398a9a 100755 --- a/experiment/scripts/database.sh +++ b/experiment/scripts/database.sh @@ -229,7 +229,9 @@ function setup_config() { " > ${PG_CONF}/exchange.conf # Must be done here otherwise pg does not start a second time - if [[ ${NUM_AUDITORS} -gt 0 ]]; then + if [[ ${NUM_AUDITORS} -ge 1 ]] && \ + [[ ${TALER_SETUP_AUDITOR_REPLICATION} == 1 ]]; + then echo "wal_level=logical" >> ${PG_CONF}/exchange.conf fi @@ -259,7 +261,9 @@ function setup_pgbouncer() { # Enable replication to the auditor - is only done when an auditor node is present function setup_replication() { - if [[ "${NUM_AUDITORS}" -gt 0 ]]; then + if [[ "${NUM_AUDITORS}" -ge 1 ]] && \ + [[ ${TALER_SETUP_AUDITOR_REPLICATION} == 1 ]]; + then su postgres << EOF createuser --replication egress psql -tAc "ALTER ROLE egress WITH PASSWORD '${DB_PASSWORD}';" || true diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh index 0614b11..52d0e97 100755 --- a/experiment/scripts/monitor.sh +++ b/experiment/scripts/monitor.sh @@ -91,7 +91,9 @@ function configure_prometheus_and_exporters() { /etc/default/prometheus-postgres-exporter CFG="" - if [[ ${NUM_AUDITORS} -ge 1 ]]; then + if [[ ${NUM_AUDITORS} -ge 1 ]] && \ + [[ ${TALER_SETUP_AUDITOR_REPLICATION} == 1 ]]; + then CFG="${CFG},postgresql://postgres@auditor.${DNS_ZONE}:5432" fi sed -i "s|<AUDITOR_DB_URL_HERE>|${CFG}|g" \ |