Not able to Configure Slave Postgresssql on FIve node setup in Apigee-OPDK

Hi folks,

I'm working on a demo of apigee OPDK of 5 node non-production setup. By the following doc, all the four nodes are configured and working as expected but facing an issue with the 5th node that is of Slave PostgressSQL for Analytics.

Below attached pic will show the error I'm facing:

11088-capture.png

I tried changing the config file for the path allocation of pg_hba.conf then also facing the same error of FATAL and NO_PIDFILE. Any suggestion would be of great help.

Thanks in advance

0 2 507
2 REPLIES 2

From the error message it seems the second postgres server (configured as standby) cannot connect to the first server (master).

you have to check:

1. the master is installed first on node-4.

2. the master is up and running and you can validate it with

apigee-service apigee-postgres postgres-check-master

3. there is connectivity between node-4 and node-5 (22/TCP and 5432/TCP)

4. both PostgreSQL servers are installed with the same config file, containing:

PG_MASTER=$IP_node4
PG_STANDBY=$IP_node5

Here is an example output of successful standby installation

Installed:
  apigee-postgresql.noarch 0:9.6.1-0.0.2016

Dependency Installed:
  postgresql96.x86_64 0:9.6.1-1PGDG.rhel7
  postgresql96-contrib.x86_64 0:9.6.1-1PGDG.rhel7
  postgresql96-libs.x86_64 0:9.6.1-1PGDG.rhel7
  postgresql96-server.x86_64 0:9.6.1-1PGDG.rhel7

Complete!
Validating setup variables
Checking for required variables
Checking required variable HOSTIP...OK
Checking required variable RUN_USER...OK
Checking required variable RUN_GROUP...OK

Checking for optional variables
Found optional variable PG_MASTER...OK
Found optional variable PG_STANDBY...OK
Running configure..
The file lib/settings was changed
[ChangeDelta, position: 0, lines: [#Automatically generated placeholder] to [APPLICATION_EXE=$COMPONENT_ROOT/pgsql/bin/postgres, EXTRA_ARGS="-p 5432 -D $APIGEE_APP_DATADIR/pgdata", LOCKFILE="/opt/apigee/var/run/$NAME.lock"]]
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_PIDFILE)
Initializing database: Creating directory /opt/apigee/data/apigee-postgresql/pgdata
This node is configured as Standby
apigee-service: apigee-postgresql: Not running (NO_PIDFILE)
apigee-service: apigee-postgresql: Not running (NO_PIDFILE)
WARNING:  skipping special file "./pg_hba.conf"
WARNING:  skipping special file "./postgresql.conf"
WARNING:  skipping special file "./recovery_conf.txt"
transaction log start point: 0/2000028 on timeline 1
pg_basebackup: starting background WAL receiver
WARNING:  skipping special file "./pg_hba.conf"esql/pgdata//backup_label)
WARNING:  skipping special file "./postgresql.conf"
WARNING:  skipping special file "./recovery_conf.txt"
30925/30925 kB (100%), 1/1 tablespace                                         
transaction log end point: 0/2000130
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: base backup completed
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_LOCKFILE)
apigee-service: apigee-postgresql: status=2, continuing
apigee-service: apigee-postgresql: OK
apigee-service: apigee-postgresql: apigee-postgresql is running
Waiting for postgres to finish start

postgres successfully started
 pg_last_xlog_receive_location 
-------------------------------
 0/3000000
(1 row)

OK
apigee-service: apigee-postgresql: OK
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_LOCKFILE)
apigee-service: apigee-postgresql: status=2, continuing
apigee-service: apigee-postgresql: OK
apigee-service: apigee-postgresql: apigee-postgresql is running
Waiting for postgres to finish start

postgres successfully started

Finished apigee-postgresql setup

I am facing the same issue in version 4.52.00. Postgresql settings are not getting replicated across the standby node. 

I could see the connectivity is present. tried telnet between the hosts on port 22 and 5432. 

johnwilliams_0-1682488509630.png

Only error I see is while setting up the standby nodes. pg_hba.conf the file is not present in node5. 

"apigee-service: apigee-postgresql: Not running (NO_PIDFILE)", "Initializing database: Creating directory /opt/apigee/data/apigee-postgresql/pgdata", "This node is configured as Standby", "apigee-service: apigee-postgresql: Not running (NO_PIDFILE)", "apigee-service: apigee-postgresql: Not running (NO_PIDFILE)", "pg_basebackup: error: connection to server at \"10.156.0.40\", port 5432 failed: FATAL: no pg_hba.conf entry for replication connection from host \"10.156.0.41\", user \"apigee\", no encryption", "Error: setup.sh: /opt/apigee/apigee-service/bin/apigee-service exited with unexpected status 1"]}

Any thoughts ? 

UPDATE: This is not working only when I run them in Ansible script where both the nodes are being setup. I just tried to setup the node5 separately and it stood up.