When initializing a PostgreSQL stream copy, note the two problems and how to handle the incorrect parameters.
Environment:
Db:postgresql 9.1
Vmware:6
Preliminary preparation (including installation and parameter setting of heat engine and standby machine).
The issue 1 parameter is equipped with the boot standby, log display
fatal:could not connect to the primary server:fe_sendauth:no password supplied
FATAL: could not connect to the primary server:fe_sendauth:no password supplied FATAL
: could don't connect to The primary server:fe_sendauth:no password supplied FATAL: Could not connect to the primary Server:fe_sendauth: No password supplied
FATAL: Could not connect to the primary server:fe_sendauth:no the password
: could not connect to the primary server:fe_sendauth:no password supplied
FATAL: could not connect to the primary server:fe_sendauth:no password supplied FATAL
: could not connect To the primary server:fe_sendauth:no password supplied
The problem shows that the password is not provided,
But check. Pgpass and Primary_conninfo and copy out the contents of Primary_conninfo Psql
Can be connected, re-examine the parameters, found standby on the machine parameters standby_mode This parameter is not adjusted, modified to make the Standby_mode = on, and then restart the standby machine, the result of this problem is resolved, the testing process found that This problem can also occur if password is not set in Primary_conninfo.
The following is the problem that comes up.
Question 2. Standby Log display:
fatal:could not connect to the primary server:FATAL:must is replication role to start Walsender
FATAL: could not connect to the primary server:fatal: must is replication role to start Walsender
FATAL: Could not connect to the primary server:fatal: must is replication role to start Walsender
FATAL: could not C Onnect to the primary server:fatal: must is replication role to start Walsender
FATAL: could don't connect to The primary server:fatal: must is replication role to start Walsender
The log on the master side shows:
fatal:must be replication to start Walsender
FATAL: must being replication to start Walsender
FATAL: Must is replication role to start Walsender
L: must being replication to start Walsender
FATAL: Must is replication role to start Walsender
8/>must be replication to start Walsender
From the log can also be seen, the role of Walsender must be replication, back to the master end of the view Repuser, really is not with replication permissions, just ordinary users. Change it.
postgres=# CREATE USER repuser REPLICATION LOGIN CONNECTION LIMIT 3 ENCRYPTED PASSWORD ' repuser ';
CREATE role
postgres=# \du
List of roles role
name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, create role, create DB, Replication | {}
Repuser | Replication +| {}
| 3 connections
Restart the slave end of the PostgreSQL again, this time normal. View view of the master end Pg_stat_replication
postgres=# Select Procpid,usename,application_name,client_addr,client_port,state,sync_state from Pg_stat_ replication;
Procpid | Usename | Application_name | Client_addr | Client_port | State | sync_state
---------+---------+------------------+---------------+-------------+-----------+--- ---------
11816 | repuser | walreceiver | 192.168.2.134 | 41205 | Streaming | Async
(1 row)
The process of creating the user found that the 9.1 version of PG creates a super user by default with replication permissions.
postgres=# Create user T_kenyon superuser;
CREATE role
postgres=# \du
List of roles role
name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, create role, create DB, Replication | {}
Repuser | Replication +| {}
| 3 connections |
T_kenyon | Superuser, Replication | {}
Summary:
Repuser is no longer required to configure Super permissions after 9.1 and needs to be careful and avoid unnecessary hassles in configuring streaming replication and other complex configurations.