at first, I want a HA PostgreSQL by repmgr
subnet its 10.0.30.0/24
da1 server 10.0.30.7 -- master da2 server 10.0.30.6 -- worker so i get error
postgres@da2:~$ repmgr -h 10.0.30.7 -U repmgr -d repmgr -f repmgr.conf standby clone --dry-run NOTICE: destination directory "/var/lib/postgresql/15/main" provided INFO: connecting to source node DETAIL: connection string is: host=10.0.30.7 user=repmgr dbname=repmgr ERROR: connection to database failed DETAIL: connection to server at "10.0.30.7", port 5432 failed: No route to host Is the server running on that host and accepting TCP/IP connections?
i can ssh
postgres@da2:~$ ssh postgres@10.0.30.7 postgres@10.0.30.7's password:
My postgresql.conf file: `listen_addresses = '*' port = 5432
`
the da1 server - master - pg_heba.conf
da1 :
# Database administrative login by Unix domain socket
local all postgres peer
local all repmgr peer
# TYPE DATABASE USER ADDRESS METHOD
host all all 10.0.30.0/24 md5
# "local" is for Unix domain socket connections only
local repmgr repmgr trust
local all all peer
# IPv4 local connections:
host repmgr repmgr 10.0.30.0/24 trust
host all all 10.0.30.0/24 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all 0.0.0.0/0 md5
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication repmgr trust
local replication all peer
host replication repmgr 10.0.30.0/24 trust
host replication replicador 10.0.30.0/24 md5
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
and da2 :
the da2 :
# Database administrative login by Unix domain socket
local all postgres peer
#local all repmgr peer
# TYPE DATABASE USER ADDRESS METHOD
host repmgr repmgr 10.0.30.7/24 md5
host all all 10.0.30.0/24 md5
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 10.0.30.0/24 md5
# IPv6 local connections:
#host all all md5
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
I check almost everything still unable to connect