postgres job from postgres/52
The Postgres server provides a single instance Postgres database that can be used with the Cloud Controller or the UAA. It does not provide highly-available configuration.
Github source:
5e330a7
or
master branch
Properties¶
databases
¶
additional_config
¶A map of additional key/value pairs to include as extra configuration properties
- Example
|+ shared_buffers: 4GB
collect_statement_statistics
¶Enable the
pg_stat_statements
extension and collect statement execution statistics
- Default
false
databases
¶A list of databases and associated properties to create
- Example
|+ - name: sandbox citext: true - name: sandbox2 citext: false
enable_trace
¶Print additional traces in control scripts
- Default
false
hooks
¶
post_start
¶Script to run after PostgreSQL has started
- Default
""- Example
|+ #!/bin/bash echo "The following databases are available:" ${PACKAGE_DIR}/bin/psql -p ${PORT} -U vcap postgres -c "\l"
post_stop
¶Script to run after PostgreSQL has stopped
- Default
""
pre_start
¶Script to run before starting PostgreSQL
- Default
""- Example
|+ #!/bin/bash echo "Going to start Postgres" echo "PostgreSQL data directory is ${DATA_DIR}" echo "PostgreSQL port is ${PORT}" echo "Package directory is ${PACKAGE_DIR}"
pre_stop
¶Script to run before stopping PostgreSQL
- Default
""
timeout
¶Time limit in seconds for the hook script. By default it’s set to 0 that means no time limit
- Default
0
log_line_prefix
¶The postgres
printf
style string that is output at the beginning of each log line
- Default
'%m: '
logging
¶
format
¶
timestamp
¶Format for timestamp in component logs. This includes pre-start, postgres_ctl, pg_janitor_ctl, janitor, and hooks; PostgreSQL logs are not included. Valid values are ‘rfc3339’, and ‘deprecated’.” ‘rfc3339’ is the recommended format, which is human readable. ‘deprecated’ will result in all timestamps being in the format they were before the rfc3339 flag was introduced.
- Default
rfc3339
max_connections
¶Maximum number of database connections
- Default
500
monit_timeout
¶Monit timout in seconds for the postgres job start. If not specified, no timeout statement will be added so that the global monit timeout applies.
- Default
90
port
¶The database port
- Default
5432
roles
¶A list of database roles and associated properties to create
- Example
|+ - name: pgadmin password: passwd permissions: - "CONNECTION LIMIT 33" - name: bud_spencer common_name: "Carlo Pedersoli"
skip_data_copy_in_minor
¶If false, during a PostgreSQL minor upgrade a copy of the data directory is created.
- Default
false
tls
¶
ca
¶PEM-encoded certification authority for secure TLS communication
- Default
""
certificate
¶PEM-encoded certificate for secure TLS communication
- Default
""
private_key
¶PEM-encoded key for secure TLS communication
- Default
""
trust_local_connections
¶Whether to trust or not local connections. Note that vcap is always trusted.
- Default
true
version
¶The database version e.g. 11, 13, 15 or 16
- Default
16
janitor
¶
interval
¶Interval in seconds between two invocations of the janitor script. By default it’s set to 1 day.
- Default
86400
script
¶If specified, janitor would periodically run this script
- Default
""- Example
|+ #!/bin/bash echo "Run VACUUM" ${PACKAGE_DIR}/bin/psql -p ${PORT} -U vcap sandbox -c "VACUUM ANALYZE"
timeout
¶Time limit in seconds for the janitor script. By default it’s set to 0 that means no time limit
- Default
0
Templates¶
Templates are rendered and placed onto corresponding
instances during the deployment process. This job's templates
will be placed into /var/vcap/jobs/postgres/
directory
(learn more).
bin/hooks/call-hooks.sh
(fromhooks/call-hooks.sh.erb
)bin/hooks/janitor.sh
(fromhooks/janitor.sh.erb
)bin/hooks/postgres-post-start.sh
(fromhooks/postgres-post-start.sh.erb
)bin/hooks/postgres-post-stop.sh
(fromhooks/postgres-post-stop.sh.erb
)bin/hooks/postgres-pre-start.sh
(fromhooks/postgres-pre-start.sh.erb
)bin/hooks/postgres-pre-stop.sh
(fromhooks/postgres-pre-stop.sh.erb
)bin/pg_janitor.sh
(frompg_janitor.sh.erb
)bin/pg_janitor_ctl
(frompg_janitor_ctl.sh.erb
)bin/pgconfig.sh
(frompgconfig.sh.erb
)bin/postgres_ctl
(frompostgres_ctl.sh.erb
)bin/postgres_start.sh
(frompostgres_start.sh.erb
)bin/pre-start
(frompre-start.sh.erb
)bin/utils.sh
(fromutils.sh.erb
)config/certificates/server.ca_cert
(fromserver.ca_cert.erb
)config/certificates/server.private_key
(fromserver.private_key.erb
)config/certificates/server.public_cert
(fromserver.public_cert.erb
)config/pg_hba.conf
(frompg_hba.conf.erb
)config/pg_ident.conf
(frompg_ident.conf.erb
)config/postgresql.conf
(frompostgresql.conf.erb
)config/roles.sql
(fromroles.sql.erb
)config/used_postgresql_versions.yml
(fromused_postgresql_versions.yml
)
Packages¶
Packages are compiled and placed onto corresponding
instances during the deployment process. Packages will be
placed into /var/vcap/packages/
directory.