OnPrem Apigee 4.16.01 - apigee-postgresql is dead

Hi experts,

Any idea about the following issue. Please also tell where I can find the log files for the apigee components.

[saifulislamkhan@apigee-edge ~]$ /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql start
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_LOCKFILE)
apigee-service: apigee-postgresql: status=2, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: status=3, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: apigee-postgresql is dead
[saifulislamkhan@apigee-edge ~]$ /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.webwerks.com
* extras: centos.webwerks.com
* updates: mirrors.nhanhoa.com
No packages marked for update
[saifulislamkhan@apigee-edge ~]$ /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup
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
apigee-service: apigee-postgresql: Not running (DEAD)
Missing PG_MASTER, assuming stand-alone.
Data directory is not empty!
Skipping database initialization
Creating symlinks for config files
Restarting apigee-postgresql
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_LOCKFILE)
apigee-service: apigee-postgresql: status=2, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: status=3, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: apigee-postgresql is dead
Waiting for postgres to finish start
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/opt/apigee/var/run/apigee-postgresql/.s.PGSQL.5432"?
Retrying in 5 sec (1)
^Z
[3]+ Stopped /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup
[saifulislamkhan@apigee-edge ~]$ /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql start
apigee-configutil: apigee-postgresql: # OK
apigee-service: apigee-postgresql: Not running (NO_LOCKFILE)
apigee-service: apigee-postgresql: status=2, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: status=3, continuing
apigee-service: apigee-postgresql: Not running (DEAD)
apigee-service: apigee-postgresql: apigee-postgresql is dead

Solved Solved
1 8 3,842
2 ACCEPTED SOLUTIONS

Not applicable

Hi there!

Can you check the logs for apigee-postgresql? You can find the logs under /opt/apigee/var/log/apigee-postgresql. Check pgstartup.log and postgresql-*.log. It should give you the enough info about the issue. Hope this helps.

Thanks,

Archendra

View solution in original post

Hi experts,

After all the hard work I found the solution. As I am new to Apigee OPDK, I didn't new where the logs were. Finally I found it and saw it was a permission issue for the postgresql data directory. I changed the directory read, write & execute permissions and that worked out for me. Following are the steps I performed to get rid of the issue:

  1. //Log file for Apigee-postgresql folder is located at /opt/apigee/var/log/apigee-postgresql/apigee-postgresql.log
  2. Found the data directory at location "/opt/apigee/data/apigee-postgresql/pgdata"
  3. changed the permission in two steps:
    1. sudo chown -R apigee:apigee /opt/apigee (This was just making sure for the owning rights)
    2. sudo chmod -R 700 /opt/apigee/data/apigee-postgresql/pgdata (changing permission)
  4. /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup (will also start the component)

Note: This issue normally will not happen. It was due to my system shutdown abnormally and after facing the issue I uninstalled and then reinstalled the apigee-postgresql without checking the logs. Lesson learnt always check the log files, they mostly say everything.

View solution in original post

8 REPLIES 8

Not applicable

Hi there!

Can you check the logs for apigee-postgresql? You can find the logs under /opt/apigee/var/log/apigee-postgresql. Check pgstartup.log and postgresql-*.log. It should give you the enough info about the issue. Hope this helps.

Thanks,

Archendra

Thanks Archendra, That was the issue.

Hi experts,

After all the hard work I found the solution. As I am new to Apigee OPDK, I didn't new where the logs were. Finally I found it and saw it was a permission issue for the postgresql data directory. I changed the directory read, write & execute permissions and that worked out for me. Following are the steps I performed to get rid of the issue:

  1. //Log file for Apigee-postgresql folder is located at /opt/apigee/var/log/apigee-postgresql/apigee-postgresql.log
  2. Found the data directory at location "/opt/apigee/data/apigee-postgresql/pgdata"
  3. changed the permission in two steps:
    1. sudo chown -R apigee:apigee /opt/apigee (This was just making sure for the owning rights)
    2. sudo chmod -R 700 /opt/apigee/data/apigee-postgresql/pgdata (changing permission)
  4. /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup (will also start the component)

Note: This issue normally will not happen. It was due to my system shutdown abnormally and after facing the issue I uninstalled and then reinstalled the apigee-postgresql without checking the logs. Lesson learnt always check the log files, they mostly say everything.

Thank you @Saif ul Islam Khan for sharing the detailed solution with community, I am sure it will be helpful for others who gets into the same situation. +1

It is working for me thanks

Thanks, it helps me to start the postgresql

I faced the same error -Thank You for The log location - but for a different root cause :

apigee-configutil: apigee-postgresql: # OK # in pid 10375, pgrp=6339 -> 10375 2018-10-02 14:16:41 UTC [10375]: [1-1] user= db= host= FATAL: could not map anonymous shared memory: Cannot allocate memory 2018-10-02 14:16:41 UTC [10375]: [2-1] user= db= host= HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 2748637184 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections. 2018-10-02 14:16:41 UTC [10375]: [3-1] user= db= host= LOG: database system is shut down

i face the same issue. the log shows no errors