Django Migrate error Fe_sendauth:no password supplied

Source: Internet
Author: User
Tags postgresql

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.