fix ph_hba
This commit is contained in:
@@ -14,33 +14,22 @@ if [[ -z $UPSTREAM ]]; then
|
||||
echo "max_wal_senders = 10" >> /var/lib/postgresql/data/postgresql.conf
|
||||
echo "max_replication_slots = 10" >> /var/lib/postgresql/data/postgresql.conf
|
||||
# ensure required entries in hba
|
||||
local all all trust
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 trust
|
||||
# IPv6 local connections:
|
||||
host all all ::1/128 trust
|
||||
# Allow replication connections from localhost, by a user with the
|
||||
# replication privilege.
|
||||
local replication all trust
|
||||
host replication all 127.0.0.1/32 trust
|
||||
host replication all ::1/128 trust
|
||||
|
||||
local replication repmgr trust
|
||||
host replication repmgr 127.0.0.1/32 trust
|
||||
host replication repmgr 100.64.0.0/10 trust
|
||||
local repmgr repmgr trust
|
||||
host repmgr repmgr 127.0.0.1/32 trust
|
||||
host repmgr repmgr 100.64.0.0/10 trust
|
||||
host all all all scram-sha-256
|
||||
echo "local all all trust" > /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "local replication repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host replication repmgr 127.0.0.1/32 trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host replication repmgr 100.64.0.0/10 trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "local repmgr repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host repmgr repmgr 127.0.0.1/32 trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host repmgr repmgr 100.64.0.0/10 trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host all all all scram-sha-256" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
|
||||
|
||||
|
||||
echo "local replication repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host replication repmgr ${NETWORK:-100.64.0.0/10} trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "local repmgr repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
echo "host repmgr repmgr ${NETWORK:-100.64.0.0/10} trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
# echo "local replication repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
# echo "host replication repmgr ${NETWORK:-100.64.0.0/10} trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
# echo "local repmgr repmgr trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
# echo "host repmgr repmgr ${NETWORK:-100.64.0.0/10} trust" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
# create user for replication
|
||||
psql -c "CREATE USER repmgr WITH REPLICATION ENCRYPTED PASSWORD '${REPLICATOR_PASSWORD}';"
|
||||
psql -c "CREATE USER repmgr WITH SUPERUSER ENCRYPTED PASSWORD '${REPLICATOR_PASSWORD}';"
|
||||
psql -c "CREATE DATABASE repmgr WITH OWNER repmgr;"
|
||||
psql -c 'ALTER USER repmgr SET search_path TO repmgr, "$user", public;'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user