PostgreSQL
Service overview
| Software owner | The PostgreSQL Global Development Group |
|---|---|
| Vesion | 9.5.9-1 |
| Management | wfmanager (start | stop | restart | status) postgresql |
| Log files | Access logs: ${install_dir}/supervisord/log/postgresql.out.log |
| Startup scripts | ${install_dir}/supervisord/apps/postgresql.ini ${install_dir}/postgres/bin/postgres |
| Configuration files | postgresql main config file: ${install_dir}/postgres/data/postgresql.conf |
| Default Ports | tcp 5432 |
Default parameters
| Configuration file | Name | Default Value | Description |
|---|---|---|---|
| config.yml | install_dir | /opt/workfusion | Directory to put user files, logs and configs |
| config.yml | postgresql_port | 5432 | Default service port for PostgreSQL DB |
| secrets.yml | postgresql_admin_user | postgres | Admin username for PostgreSQL DB on DB server |
| secrets.yml | postgresql_admin_pass | postgres | Admin password for PostgreSQL DB on DB server |
Troubleshooting
Check if TCP port 5432 is available (port may be custom).
netstat command output
$ netstat -lntp | grep 5432 tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 17628/postgres tcp6 0 0 :::5432 :::* LISTEN 17628/postgresss command output
$ ss -ltn | grep 5432 LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*lsof command output
$ lsof -P -n -i :5432 | grep LISTEN postgres 17628 wfuser 3u IPv4 175661 0t0 TCP *:5432 (LISTEN) postgres 17628 wfuser 4u IPv6 175662 0t0 TCP *:5432 (LISTEN)Check the default log files:
- Access logs:
${install_dir}/supervisord/log/postgresql.out.log - Error logs:
${install_dir}/supervisord/log/postgresql.err.log
$ tail -f ${install_dir}/supervisord/log/postgresql.err.log ${install_dir}/supervisord/log/postgresql.out.logWfmanager util can be used to check postgresql out (access) log:
wfmanager tail postgresql- Access logs:
Enabling debug information.
Add the appropriate options to
${install_dir}/postgres/data.postgres.confand restart postgresql service.${install_dir}/postgres/data.postgres.conf
#log_line_prefix = '' # special values: # %a = application name # %u = user name # %d = database name # %r = remote host and port # %h = remote host # %p = process ID # %t = timestamp without milliseconds # %m = timestamp with milliseconds # %i = command tag # %e = SQL state # %c = session ID # %l = session line number # %s = session start timestamp # %v = virtual transaction ID # %x = transaction ID (0 if none) # %q = stop here in non-session # processes # %% = '%' #, for example, '<%u%%%d> 'For example:
log_line_prefix = '[%p] [%c] [%m] [%x]: ' log_statement = 'all'wfmanager restart postgresql