puppet: Rename postgres_appdb to postgresql.

There is only one PostgreSQL database; the "appdb" is irrelevant.
Also use "postgresql," as it is the name of the software, whereas
"postgres" the name of the binary and colloquial name.  This is minor
cleanup, but enabled by the other renames in the previous commit.
This commit is contained in:
Alex Vandiver
2020-10-19 19:10:17 -07:00
committed by Tim Abbott
parent 91cb0988e1
commit 188af57296
20 changed files with 107 additions and 108 deletions

View File

@@ -266,7 +266,7 @@ This component is intended to install Nagios plugins intended to be run
on a Nagios server; most of the Zulip Nagios plugins are intended to be
run on the Zulip servers themselves, and are included with the relevant
component of the Zulip server (e.g.
`puppet/zulip/manifests/postgres_backups.pp` installs a few under
`puppet/zulip/manifests/postgresql_backups.pp` installs a few under
`/usr/lib/nagios/plugins/zulip_backups`).
## Glossary

View File

@@ -162,7 +162,7 @@ data includes:
* The Postgres database. You can back it up like any Postgres
database. We have some example tooling for doing that incrementally
into S3 using [wal-g](https://github.com/wal-g/wal-g) in
`puppet/zulip/manifests/postgres_backups.pp`.
`puppet/zulip/manifests/postgresql_backups.pp`.
In short, this requires:
- Zulip 1.4 or newer release.
- An Amazon S3 bucket for storing the backups.
@@ -174,7 +174,7 @@ In short, this requires:
s3_backups_bucket = # name of S3 backup
```
- A cron job to run `/usr/local/bin/pg_backup_and_purge.py`. There's puppet
config for this in `puppet/zulip/manifests/postgres_backups.pp`.
config for this in `puppet/zulip/manifests/postgresql_backups.pp`.
- Verification that backups are running via
`/usr/lib/nagios/plugins/zulip_postgres_backups/check_postgres_backup`.

View File

@@ -11,7 +11,7 @@ class zulip::app_frontend_base {
# shell. This is not necessary on CentOS because the PostgreSQL
# package already includes the client. This may get us a more
# recent client than the database server is configured to be,
# ($zulip::postgres_common::version), but they're compatible.
# ($zulip::postgresql_common::version), but they're compatible.
zulip::safepackage { 'postgresql-client': ensure => 'installed' }
}
# For Slack import

View File

@@ -1,4 +1,4 @@
# @summary Temporary shim for postgres database server profile
# @summary Temporary shim for postgresql database server profile
class zulip::postgres_appdb_tuned {
include zulip::profile::postgres_appdb_tuned
include zulip::profile::postgresql
}

View File

@@ -1,7 +1,7 @@
# @summary Use wal-g to take daily backups of PostgreSQL
#
class zulip::postgres_backups {
include zulip::postgres_common
class zulip::postgresql_backups {
include zulip::postgresql_common
$wal_g_version = '0.2.15'
zulip::sha256_tarball_to { 'wal-g':
@@ -21,7 +21,7 @@ class zulip::postgres_backups {
group => 'postgres',
mode => '0750',
source => 'puppet:///modules/zulip/postgresql/env-wal-g',
require => Package[$zulip::postgres_common::postgresql],
require => Package[$zulip::postgresql_common::postgresql],
}
file { '/usr/local/bin/pg_backup_and_purge':
@@ -33,7 +33,7 @@ class zulip::postgres_backups {
require => [
File['/usr/local/bin/env-wal-g'],
Package[
$zulip::postgres_common::postgresql,
$zulip::postgresql_common::postgresql,
'python3-dateutil',
],
],

View File

@@ -1,38 +1,38 @@
# Minimal shared configuration needed to run a Zulip Postgres database.
class zulip::postgres_appdb_base {
include zulip::postgres_common
# Minimal shared configuration needed to run a Zulip PostgreSQL database.
class zulip::postgresql_base {
include zulip::postgresql_common
include zulip::process_fts_updates
case $::osfamily {
'debian': {
$postgresql = "postgresql-${zulip::postgres_common::version}"
$postgres_sharedir = "/usr/share/postgresql/${zulip::postgres_common::version}"
$postgresql = "postgresql-${zulip::postgresql_common::version}"
$postgres_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}"
$postgres_confdirs = [
"/etc/postgresql/${zulip::postgres_common::version}",
"/etc/postgresql/${zulip::postgres_common::version}/main",
"/etc/postgresql/${zulip::postgresql_common::version}",
"/etc/postgresql/${zulip::postgresql_common::version}/main",
]
$postgres_confdir = $postgres_confdirs[-1]
$postgres_datadir = "/var/lib/postgresql/${zulip::postgres_common::version}/main"
$postgres_datadir = "/var/lib/postgresql/${zulip::postgresql_common::version}/main"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
$setup_system_deps = 'setup_apt_repo'
$postgres_restart = "pg_ctlcluster ${zulip::postgres_common::version} main restart"
$postgres_restart = "pg_ctlcluster ${zulip::postgresql_common::version} main restart"
$postgres_dict_dict = '/var/cache/postgresql/dicts/en_us.dict'
$postgres_dict_affix = '/var/cache/postgresql/dicts/en_us.affix'
}
'redhat': {
$postgresql = "postgresql${zulip::postgres_common::version}"
$postgres_sharedir = "/usr/pgsql-${zulip::postgres_common::version}/share"
$postgresql = "postgresql${zulip::postgresql_common::version}"
$postgres_sharedir = "/usr/pgsql-${zulip::postgresql_common::version}/share"
$postgres_confdirs = [
"/var/lib/pgsql/${zulip::postgres_common::version}",
"/var/lib/pgsql/${zulip::postgres_common::version}/data",
"/var/lib/pgsql/${zulip::postgresql_common::version}",
"/var/lib/pgsql/${zulip::postgresql_common::version}/data",
]
$postgres_confdir = $postgres_confdirs[-1]
$postgres_datadir = "/var/lib/pgsql/${zulip::postgres_common::version}/data"
$postgres_datadir = "/var/lib/pgsql/${zulip::postgresql_common::version}/data"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data/"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
$setup_system_deps = 'setup_yum_repo'
$postgres_restart = "systemctl restart postgresql-${zulip::postgres_common::version}"
$postgres_restart = "systemctl restart postgresql-${zulip::postgresql_common::version}"
# TODO Since we can't find the Postgres dicts directory on CentOS yet, we
# link directly to the hunspell directory.
$postgres_dict_dict = '/usr/share/myspell/en_US.dic'

View File

@@ -1,6 +1,5 @@
class zulip::postgres_common {
class zulip::postgresql_common {
$version = zulipconf('postgresql', 'version', undef)
case $::osfamily {
'debian': {
$postgresql = "postgresql-${version}"

View File

@@ -1,8 +1,8 @@
# postgres_appdb_tuned extends postgres_appdb_base by automatically
# generating tuned database configuration.
class zulip::profile::postgres_appdb_tuned {
class zulip::profile::postgresql {
include zulip::profile::base
include zulip::postgres_appdb_base
include zulip::postgresql_base
$work_mem = $zulip::common::total_memory_mb / 512
$shared_buffers = $zulip::common::total_memory_mb / 8
@@ -18,24 +18,24 @@ class zulip::profile::postgres_appdb_tuned {
$ssl_key_file = zulipconf('postgresql', 'ssl_key_file', undef)
$ssl_ca_file = zulipconf('postgresql', 'ssl_ca_file', undef)
file { $zulip::postgres_appdb_base::postgres_confdirs:
file { $zulip::postgresql_base::postgres_confdirs:
ensure => directory,
owner => 'postgres',
group => 'postgres',
}
$postgres_conf_file = "${zulip::postgres_appdb_base::postgres_confdir}/postgresql.conf"
$postgres_conf_file = "${zulip::postgresql_base::postgres_confdir}/postgresql.conf"
file { $postgres_conf_file:
ensure => file,
require => Package[$zulip::postgres_appdb_base::postgresql],
require => Package[$zulip::postgresql_base::postgresql],
owner => 'postgres',
group => 'postgres',
mode => '0644',
content => template("zulip/postgresql/${zulip::postgres_common::version}/postgresql.conf.template.erb"),
content => template("zulip/postgresql/${zulip::postgresql_common::version}/postgresql.conf.template.erb"),
}
exec { $zulip::postgres_appdb_base::postgres_restart:
require => Package[$zulip::postgres_appdb_base::postgresql],
exec { $zulip::postgresql_base::postgres_restart:
require => Package[$zulip::postgresql_base::postgresql],
refreshonly => true,
subscribe => [ File[$postgres_conf_file] ],
}

View File

@@ -9,7 +9,7 @@
class zulip::profile::standalone {
include zulip::profile::base
include zulip::profile::app_frontend
include zulip::profile::postgres_appdb_tuned
include zulip::profile::postgresql
include zulip::profile::redis
include zulip::profile::memcached
include zulip::profile::rabbit

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid'
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid'
# (change requires restart)
@@ -473,7 +473,7 @@ log_line_prefix = '%m [%p] ' # special values:
# - Process Title -
#cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
#cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -473,7 +473,7 @@ log_timezone = 'UTC'
# - Process Title -
cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -489,7 +489,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -473,7 +473,7 @@ log_timezone = 'UTC'
# - Process Title -
cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -489,7 +489,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -542,7 +542,7 @@ log_timezone = 'UTC'
# PROCESS TITLE
#------------------------------------------------------------------------------
cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -558,7 +558,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Monitoring -
@@ -770,10 +770,10 @@ vacuum_freeze_table_age = 1800000000
# Performance settings
max_connections = 1000
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -462,7 +462,7 @@ log_timezone = 'localtime'
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -648,10 +648,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -461,7 +461,7 @@ log_timezone = 'UTC'
# - Process Title -
cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -477,7 +477,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -661,10 +661,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>

View File

@@ -1,7 +1,7 @@
class zulip_ops::postgres_appdb {
include zulip_ops::base
include zulip::profile::postgres_appdb_tuned
include zulip::postgres_backups
include zulip::profile::postgresql
include zulip::postgresql_backups
$common_packages = ['xfsprogs']
package { $common_packages: ensure => 'installed' }
@@ -28,13 +28,13 @@ class zulip_ops::postgres_appdb {
}
exec { 'setup_disks':
command => '/root/setup_disks.sh',
require => Package["postgresql-${zulip::postgres_common::version}", 'xfsprogs'],
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs'],
unless => 'test $(readlink /var/lib/postgresql) = "/srv/postgresql/" -a -d /srv/postgresql',
}
file { "${zulip::postgres_appdb_base::postgres_confdir}/pg_hba.conf":
file { "${zulip::postgresql_base::postgres_confdir}/pg_hba.conf":
ensure => file,
require => Package["postgresql-${zulip::postgres_common::version}"],
require => Package["postgresql-${zulip::postgresql_common::version}"],
owner => 'postgres',
group => 'postgres',
mode => '0640',

View File

@@ -233,7 +233,7 @@ EOF
fi
case ",$PUPPET_CLASSES," in
*,zulip::profile::standalone,* | *,zulip::profile::postgres_appdb_tuned,*)
*,zulip::profile::standalone,* | *,zulip::profile::postgresql,*)
if [ "$package_system" = apt ]; then
# We're going to install Postgres from the Postgres apt
# repository; this may conflict with the existing Postgres.
@@ -408,7 +408,7 @@ EOF
# We only need the Postgres version setting on database hosts; but
# we don't know if this is a database host until we have the catalog summary.
if ! has_class "zulip::postgres_common" || [ "$package_system" != apt ]; then
if ! has_class "zulip::postgresql_common" || [ "$package_system" != apt ]; then
crudini --del /etc/zulip/zulip.conf postgresql
fi
@@ -496,7 +496,7 @@ EOF
"$ZULIP_PATH"/scripts/setup/configure-rabbitmq
fi
if has_class "zulip::postgres_common" && [ -z "$NO_INIT_DB" ]; then
if has_class "zulip::postgresql_common" && [ -z "$NO_INIT_DB" ]; then
"$ZULIP_PATH"/scripts/setup/postgres-init-db
fi

View File

@@ -31,7 +31,7 @@ fi
cp /etc/zulip/zulip.conf "$TEMP_CONF_DIR"
ZULIP_CONF="${TEMP_CONF_DIR}/zulip.conf"
crudini --set "$ZULIP_CONF" postgresql version "$UPGRADE_TO"
crudini --set "$ZULIP_CONF" machine puppet_classes zulip::profile::base,zulip::postgres_appdb_base
crudini --set "$ZULIP_CONF" machine puppet_classes zulip::profile::base,zulip::postgresql_base
touch "/usr/share/postgresql/$UPGRADE_TO/pgroonga_setup.sql.applied"
"$ZULIP_PATH"/scripts/zulip-puppet-apply -f --config "$ZULIP_CONF"

View File

@@ -11,7 +11,7 @@ if [ -z "$SERVER" ] || [ -z "$ROLES" ]; then
echo
echo " * server is the local part of the hostname (e.g. postgres0)"
echo " * roles is a comma-separated list of Puppet rules to be passed to scripts/lib/install"
echo " E.g. 'zulip::profile::postgres_appdb_tuned'"
echo " E.g. 'zulip::profile::postgresql'"
echo " * branch is used to override the default branch to install from."
echo
echo "Reads configuration from $HOME/.zulip-install-server.conf, which should look like:"