pg_upgrade on AWS EC2 linux - pg_hba.conf settings

1.5k Views Asked by At

I am running an Amazon EC2 CentOS 6.6 server instance with pre-installed PostgreSQL 8.4.20 server which I want to upgrade to 9.4.1 using pg_upgrade via SSH.

What I've done so far: Downloaded and installed PostgreSQL 9.4.1 with yum, configured it. Configured the postgres user to have the same password on the UNIX server and for both database instances. Both database instances are functioning correctly - old one on port 5432, new on 5433.

What I am trying to do:

su - postgres
/usr/pgsql-9.4/bin/pg_upgrade 
    -b /usr/bin/ 
    -B /usr/pgsql-9.4/bin/ 
    -d /var/lib/pgsql/data/ 
    -D /var/lib/pgsql/9.4/data/

Here is my issue with pg_hba.conf. Using

TYPE DATABASE USER METHOD
local all all trust

or

TYPE DATABASE USER METHOD
local all all peer

I can't start the old server, getting:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
connection to database failed: fe_sendauth: no password supplied

Failure, exiting

Using the default setting

TYPE DATABASE USER METHOD
local all all ident

is the only method that allows me to start the server, but then I get the following error:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok

*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.

connection to database failed: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.50432"?


could not connect to old postmaster started with the command:
"/usr/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data/" -o "-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000  -c listen_addresses='' -c unix_socket_permissions=0700" start
Failure, exiting

I have been reading more than 10 hours straight everything related, before I posted this, but can't seem to find the solution. Will be very grateful if you can give me any hints.

0

There are 0 best solutions below