2022-04-29 03:03:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# https://docs.timescale.com/timescaledb/latest/how-to-guides/configuration/timescaledb-config/#timescaledb-last-tuned-string
|
|
|
|
# https://docs.timescale.com/timescaledb/latest/how-to-guides/multi-node-setup/required-configuration/
|
|
|
|
|
|
|
|
# It is necessary to change the parameter max_prepared_transactions to a non-zero value ('150' is recommended).
|
|
|
|
# https://www.postgresql.org/docs/12/runtime-config-resource.html#max_prepared_transactions
|
|
|
|
sed -ri "s!^#?(max_prepared_transactions)\s*=.*!\1 = 150!" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
grep "max_prepared_transactions" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
|
|
|
|
# Statement timeout should be disabled on the data nodes and managed through the access node configuration if desired.
|
|
|
|
# https://www.postgresql.org/docs/12/runtime-config-client.html#statement_timeout
|
|
|
|
sed -ri "s!^#?(statement_timeout)\s*=.*!\1 = 0!" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
grep "statement_timeout" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
|
2022-05-02 04:33:25 +00:00
|
|
|
# On the data nodes, set the wal_level to logical or higher to move or copy chunks between data nodes.
|
|
|
|
# https://www.postgresql.org/docs/14/runtime-config-wal.html
|
|
|
|
sed -ri "s!^#?(wal_level)\s*=.*!\1 = 'logical'!" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
grep "wal_level" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
|
2022-04-29 03:03:16 +00:00
|
|
|
# https://docs.timescale.com/timescaledb/latest/how-to-guides/multinode-timescaledb/multinode-auth/
|
|
|
|
# https://docs.timescale.com/timescaledb/latest/how-to-guides/multinode-timescaledb/multinode-auth/#password-authentication
|
|
|
|
|
|
|
|
# Set password_encryption = 'scram-sha-256' in postgresql.conf on the data node.
|
|
|
|
sed -ri "s!^#?(password_encryption)\s*=.*!\1 = 'scram-sha-256'!" /var/lib/postgresql/data/postgresql.conf
|
|
|
|
grep "password_encryption" /var/lib/postgresql/data/postgresql.conf
|