Merge ~cjwatson/launchpad-mojo-specs:lp-db into launchpad-mojo-specs:master

Proposed by Colin Watson
Status: Needs review
Proposed branch: ~cjwatson/launchpad-mojo-specs:lp-db
Merge into: launchpad-mojo-specs:master
Diff against target: 519 lines (+408/-0)
18 files modified
lp-db/README.md (+26/-0)
lp-db/bundle.yaml (+154/-0)
lp-db/configs/custom-secgroups-qastaging.yaml (+46/-0)
lp-db/configs/custom-secgroups-staging.yaml (+55/-0)
lp-db/manifest (+1/-0)
lp-db/manifest-verify (+1/-0)
lp-db/manifests/deploy (+5/-0)
lp-db/manifests/secgroups (+1/-0)
lp-db/manifests/verify (+4/-0)
lp-db/predeploy (+9/-0)
lp-db/qastaging/extra_pg.conf (+30/-0)
lp-db/qastaging/pgbouncer_databases.ini (+4/-0)
lp-db/qastaging/pgbouncer_extra_config.txt (+14/-0)
lp-db/staging/extra_pg.conf (+31/-0)
lp-db/staging/pgbouncer_databases.ini (+4/-0)
lp-db/staging/pgbouncer_extra_config.txt (+14/-0)
lp-db/utils (+1/-0)
lp-db/verify (+8/-0)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Simone Pelosi Approve
Review via email: mp+456432@code.launchpad.net

Commit message

lp-db: New spec

Description of the change

I agreed with William that we should keep our PostgreSQL databases in a separate environment even once we start deploying them using our own Mojo specs, which means we need a standalone spec for them. So far this only handles staging and qastaging, but it can be expanded to cover production as well in the future.

The current staging and qastaging databases are sort of deployed using this, but we really need to upgrade them to PostgreSQL 12 before `mojo run` will work properly.

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) wrote :

LGTM!

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Needs Fixing
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve
Revision history for this message
Simone Pelosi (pelpsi) wrote :

Please, merge this only when Postgresql is upgraded to version 12.

Revision history for this message
Colin Watson (cjwatson) wrote :

That might not be a good plan. At least as I'd planned it in November, the path to upgrading PostgreSQL to version 12 required first deploying a new production DB environment using this spec, temporarily manually installing PostgreSQL 10 in it so that it can be replicated from the current primary, switching the primary to this one, and then upgrading. (Otherwise you'd have to get PostgreSQL 12 wedged into the current cluster, which IIRC is on bionic, and that seemed worse.)

But I suppose it would be possible to just deploy the new production environment from this branch. I don't think it makes a whole lot of difference either way.

Unmerged commits

e8f2d09... by Colin Watson

lp-db: New spec

I agreed with William that we should keep our PostgreSQL databases in a
separate environment even once we start deploying them using our own
Mojo specs, which means we need a standalone spec for them. So far this
only handles staging and qastaging, but it can be expanded to cover
production as well in the future.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lp-db/README.md b/lp-db/README.md
0new file mode 1006440new file mode 100644
index 0000000..54a263a
--- /dev/null
+++ b/lp-db/README.md
@@ -0,0 +1,26 @@
1# Launchpad standalone database deployment
2
3This spec deploys the Launchpad PostgreSQL database. While the `lp` spec
4also supports deploying PostgreSQL directly to keep local test deployments
5simple, for non-test deployments we prefer to deploy PostgreSQL separately
6from the rest of Launchpad to reduce the risk of ordinary code deployments
7causing database havoc due to Juju bugs.
8
9You can run this spec locally using Juju's LXD support and Mojo. First,
10configure your environment:
11
12 export MOJO_ROOT="$HOME/.local/share/mojo"
13 export MOJO_PROJECT=mojo-lp-db
14 export MOJO_WORKSPACE=devel
15 export MOJO_SERIES=focal
16 export MOJO_SPEC=git+https://git.launchpad.net/launchpad-mojo-specs
17 export MOJO_STAGE=lp-db/devel
18
19Then run the spec using Mojo:
20
21 mojo project-new -c containerless
22 mojo workspace-new
23 mojo run
24
25See the "Initial database setup" section of `lp/README.md` for how to set up
26the contents of the database.
diff --git a/lp-db/bundle.yaml b/lp-db/bundle.yaml
0new file mode 10064427new file mode 100644
index 0000000..7382b8c
--- /dev/null
+++ b/lp-db/bundle.yaml
@@ -0,0 +1,154 @@
1{#- Defaults. #}
2{%- set cron_mailto = "launchpad-error-reports@lists.canonical.com" %}
3{#- Address of corresponding launchpad-db-update unit. #}
4{%- set db_update_ip = "" %}
5{%- set devel = False %}
6{#- Network where this bundle is deployed. #}
7{%- set local_network = "" %}
8
9{%- if stage_name == "production" %}
10{%- set dbname_launchpad = "launchpad_prod" %}
11{%- set dbname_session = "session_prod" %}
12{%- set nagios_context = "prod-launchpad" %}
13{%- set nagios_hostgroups = "prodstack-lp" %}
14{%- set nagios_master = "nagios.ps5.internal" %}
15{%- set postgresql_constraints = "cores=16 mem=256G root-disk=3000G root-disk-source=local" %}
16{%- set postgresql_num_units = 3 %}
17{%- elif stage_name == "staging" %}
18{%- set db_update_ip = "10.132.54.153" %}
19{%- set dbname_launchpad = "lpmain_staging" %}
20{%- set dbname_session = "session_staging" %}
21{%- set local_network = "10.132.64.0/24" %}
22{%- set nagios_context = "staging-launchpad" %}
23{%- set nagios_hostgroups = "stagingstack-lp" %}
24{%- set nagios_master = "devops-nagios.ps5.internal" %}
25{%- set postgresql_constraints = "cores=8 mem=16G root-disk=3000G root-disk-source=local" %}
26{%- set postgresql_num_units = 2 %}
27{%- elif stage_name == "qastaging" %}
28{%- set db_update_ip = "10.132.54.103" %}
29{%- set dbname_launchpad = "launchpad_qastaging" %}
30{%- set dbname_session = "session_qastaging" %}
31{%- set local_network = "10.132.223.0/24" %}
32{%- set nagios_context = "qastaging-launchpad" %}
33{%- set nagios_hostgroups = "stagingstack-lp" %}
34{%- set nagios_master = "devops-nagios.ps5.internal" %}
35{%- set postgresql_constraints = "cores=8 mem=16G root-disk=1500G root-disk-source=local" %}
36{%- set postgresql_num_units = 2 %}
37{%- else %}
38{%- set cron_mailto = "error-reports@launchpad.test" %}
39{%- set dbname_launchpad = "launchpad_dev" %}
40{%- set dbname_session = "session_dev" %}
41{%- set devel = True %}
42{%- set nagios_context = "devel-launchpad" %}
43{%- set nagios_hostgroups = "devel-lp" %}
44{#- The configured nagios_master doesn't have to be real, but it does have
45 to resolve. #}
46{%- set nagios_master = "localhost" %}
47{%- set postgresql_num_units = 1 %}
48{%- endif -%}
49
50series: focal
51applications:
52 postgresql:
53 charm: ch:postgresql
54 channel: latest/stable
55 revision: 345
56 constraints: "{{ postgresql_constraints }}"
57 num_units: {{ postgresql_num_units }}
58 options:
59 admin_addresses: "127.0.0.1"
60{%- if stage_name == "staging" %}
61{#- Backups of staging take a long time, and they interfere with the weekly
62 restore of staging from production. They aren't very useful due to that
63 weekly restore, so just disable them. #}
64 backup_schedule: ""
65{%- endif %}
66 extra_pg_auth: |-
67{%- if stage_name == "production" %}
68 # Slony, running in the sso-db Juju environment.
69 host launchpad_prod slony 162.213.33.34/32 md5
70 host launchpad_prod slony 10.131.151.0/24 md5
71{%- endif %}
72 # pgbouncer connections, from localhost and from other trusted
73 # machines.
74 local {{ dbname_launchpad }} all trust
75 local {{ dbname_session }} all trust
76{%- if local_network %}
77 host {{ dbname_launchpad }} all {{ local_network }} trust
78 host {{ dbname_session }} all {{ local_network }} trust
79{%- endif %}
80{%- if stage_name in ("staging", "qastaging") %}
81 host replication stgreplication 10.22.112.54/32 trust # pamola.internal
82 host replication stgreplication 10.22.112.55/32 trust # pherkad.internal
83{%- endif %}
84{%- if db_update_ip %}
85 # Allow direct access from launchpad-db-update unit.
86 host all all {{ db_update_ip }}/32 md5
87{%- endif %}
88 extra_pg_conf: "include-file://{{ spec_dir }}/{{ stage }}/extra_pg.conf"
89{%- if not devel %}
90 manual_replication: true
91{%- endif %}
92 package_status: "hold"
93 version: "12"
94 launchpad-postgresql-extras:
95 charm: ch:launchpad-postgresql-extras
96 channel: stable
97 revision: 2
98 options:
99 cron_mailto: "{{ cron_mailto }}"
100{%- if not devel %}
101 install_keys: |
102 - null
103 install_sources: |
104 - ppa:canonical-is-sa/ubuntu/launchpad
105{%- endif %}
106{%- if stage_name in ("qastaging", "staging") %}
107 pgbouncer_db_config: "include-file://{{ spec_dir }}/{{ stage }}/pgbouncer_databases.ini"
108 pgbouncer_extra_config: "include-file://{{ spec_dir }}/{{ stage }}/pgbouncer_extra_config.txt"
109 pgbouncer_userlist: "include-file://{{ local_dir }}/userlist.txt"
110{%- endif %}
111{%- if stage_name == "production" %}
112 postfix-relay:
113 charm: ch:postfix-relay
114 channel: stable
115 revision: 9
116 options:
117{#- postfix-relay/smtp_auth_username and postfix-relay/smtp_auth_password
118 must be set in secrets. #}
119 relayhost: "[launchpad.smtp.canonical.com]:25"
120{%- endif %}
121 nrpe:
122 charm: ch:nrpe
123 channel: stable
124 revision: 106
125 options:
126 export_nagios_definitions: true
127 hostgroups: "{{ nagios_hostgroups }}"
128 nagios_host_context: "{{ nagios_context }}"
129 nagios_hostname_type: host
130 nagios_master: "{{ nagios_master }}"
131 space_check: |
132 check: auto
133 auto_params: "-w 15% -c 10% -K 5%"
134 swap: ""
135 swap_activity: ""
136{%- if not devel %}
137 telegraf:
138 charm: ch:telegraf
139 channel: stable
140 revision: 73
141 expose: true
142 options:
143 install_method: snap
144{%- endif %}
145relations:
146 - ["postgresql", "launchpad-postgresql-extras"]
147{%- if stage_name == "production" %}
148 - ["postfix-relay", "postgresql"]
149{%- endif %}
150 - ["nrpe:nrpe-external-master", "postgresql:nrpe-external-master"]
151{%- if not devel %}
152 - ["telegraf:juju-info", "postgresql:juju-info"]
153 - ["telegraf:postgresql", "postgresql:db-admin"]
154{%- endif %}
diff --git a/lp-db/configs/custom-secgroups-qastaging.yaml b/lp-db/configs/custom-secgroups-qastaging.yaml
0new file mode 100644155new file mode 100644
index 0000000..6b8a8a4
--- /dev/null
+++ b/lp-db/configs/custom-secgroups-qastaging.yaml
@@ -0,0 +1,46 @@
1applications:
2 nrpe:
3 type: neutron
4 rules:
5 - nagios-monitored
6 postgresql:
7 type: neutron
8 rules:
9 - legacy-postgresql
10 - postgresql
11 - pgbouncer
12 telegraf:
13 type: neutron
14 rules:
15 - metrics
16rules:
17 legacy-postgresql:
18 # pherkad
19 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.22.112.55/32"}
20 # pamola
21 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.22.112.54/32"}
22 metrics:
23 # Allow IS Prometheus to scrape telegraf.
24 # 3FP
25 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "91.189.94.59/32"}
26 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "91.189.94.60/32"}
27 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2001:67c:1561:8008::13/128"}
28 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2001:67c:1561:8008::14/128"}
29 # IL3
30 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "185.125.190.67/32"}
31 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "185.125.190.68/32"}
32 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2620:2d:4000:1::67/128"}
33 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2620:2d:4000:1::68/128"}
34 nagios-monitored:
35 # Allow monitoring from devops-nagios.ps5.internal.
36 - {"protocol": "tcp", "family": "IPv4", "port": 22, "cidr": "10.131.26.77/32"}
37 - {"protocol": "tcp", "family": "IPv4", "port": 873, "cidr": "10.131.26.77/32"}
38 - {"protocol": "tcp", "family": "IPv4", "port": 5666, "cidr": "10.131.26.77/32"}
39 - {"protocol": "icmp", "family": "IPv4", "cidr": "10.131.26.77/32"}
40 pgbouncer:
41 # stg-launchpad@launchpad-bastion-ps5 (firewall rules apply finer-grained ACLs)
42 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.132.54.0/24"}
43 postgresql:
44 # stg-launchpad@launchpad-bastion-ps5 (firewall rules apply
45 # finer-grained ACLs; this is just for launchpad-db-update)
46 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.132.54.0/24"}
diff --git a/lp-db/configs/custom-secgroups-staging.yaml b/lp-db/configs/custom-secgroups-staging.yaml
0new file mode 10064447new file mode 100644
index 0000000..e690c9a
--- /dev/null
+++ b/lp-db/configs/custom-secgroups-staging.yaml
@@ -0,0 +1,55 @@
1applications:
2 nrpe:
3 type: neutron
4 rules:
5 - nagios-monitored
6 postgresql:
7 type: neutron
8 rules:
9 - legacy-postgresql
10 - pgbouncer
11 - postgresql
12 - push-backups
13 telegraf:
14 type: neutron
15 rules:
16 - metrics
17rules:
18 legacy-postgresql:
19 # pamola
20 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.22.112.54/32"}
21 # pherkad
22 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.22.112.55/32"}
23 metrics:
24 # Allow IS Prometheus to scrape telegraf.
25 # 3FP
26 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "91.189.94.59/32"}
27 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "91.189.94.60/32"}
28 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2001:67c:1561:8008::13/128"}
29 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2001:67c:1561:8008::14/128"}
30 # IL3
31 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "185.125.190.67/32"}
32 - {"protocol": "tcp", "family": "IPv4", "port": 9103, "cidr": "185.125.190.68/32"}
33 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2620:2d:4000:1::67/128"}
34 - {"protocol": "tcp", "family": "IPv6", "port": 9103, "cidr": "2620:2d:4000:1::68/128"}
35 nagios-monitored:
36 # Allow monitoring from devops-nagios.ps5.internal.
37 - {"protocol": "tcp", "family": "IPv4", "port": 22, "cidr": "10.131.26.77/32"}
38 - {"protocol": "tcp", "family": "IPv4", "port": 873, "cidr": "10.131.26.77/32"}
39 - {"protocol": "tcp", "family": "IPv4", "port": 5666, "cidr": "10.131.26.77/32"}
40 - {"protocol": "icmp", "family": "IPv4", "cidr": "10.131.26.77/32"}
41 pgbouncer:
42 # stg-launchpad@launchpad-bastion-ps5 (firewall rules apply finer-grained ACLs)
43 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.132.54.0/24"}
44 # Staging SSO DB
45 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.22.112.57/32"}
46 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.22.112.58/32"}
47 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.132.34.0/24"}
48 - {"protocol": "tcp", "family": "IPv4", "port": 5433, "cidr": "10.132.211.0/24"}
49 postgresql:
50 # stg-launchpad@launchpad-bastion-ps5 (firewall rules apply
51 # finer-grained ACLs; this is just for launchpad-db-update)
52 - {"protocol": "tcp", "family": "IPv4", "port": 5432, "cidr": "10.132.54.0/24"}
53 push-backups:
54 # wildcherry
55 - {"protocol": "tcp", "family": "IPv4", "port": 22, "cidr": "91.189.90.38/32"}
diff --git a/lp-db/manifest b/lp-db/manifest
0new file mode 12000056new file mode 120000
index 0000000..e1c38b1
--- /dev/null
+++ b/lp-db/manifest
@@ -0,0 +1 @@
1manifests/deploy
0\ No newline at end of file2\ No newline at end of file
diff --git a/lp-db/manifest-verify b/lp-db/manifest-verify
1new file mode 1200003new file mode 120000
index 0000000..6e02de4
--- /dev/null
+++ b/lp-db/manifest-verify
@@ -0,0 +1 @@
1manifests/verify
0\ No newline at end of file2\ No newline at end of file
diff --git a/lp-db/manifests/deploy b/lp-db/manifests/deploy
1new file mode 1006443new file mode 100644
index 0000000..3ee5195
--- /dev/null
+++ b/lp-db/manifests/deploy
@@ -0,0 +1,5 @@
1script config=predeploy
2bundle config=bundle.yaml local=deploy-secrets status-timeout=3600
3juju-check-wait
4include config=manifests/secgroups
5include config=manifests/verify
diff --git a/lp-db/manifests/secgroups b/lp-db/manifests/secgroups
0new file mode 1006446new file mode 100644
index 0000000..8c438ee
--- /dev/null
+++ b/lp-db/manifests/secgroups
@@ -0,0 +1 @@
1script config=utils/custom-secgroups.py SKIP_STAGES=devel
diff --git a/lp-db/manifests/verify b/lp-db/manifests/verify
0new file mode 1006442new file mode 100644
index 0000000..f25f902
--- /dev/null
+++ b/lp-db/manifests/verify
@@ -0,0 +1,4 @@
1juju-check-wait
2# It occasionally takes a little while for all the servers to start
3# accepting connections.
4verify retry=3
diff --git a/lp-db/predeploy b/lp-db/predeploy
0new file mode 1007555new file mode 100755
index 0000000..bf98e70
--- /dev/null
+++ b/lp-db/predeploy
@@ -0,0 +1,9 @@
1#! /bin/sh
2set -e
3
4TOP="${0%/*}"
5
6# Ensure that deploy-secrets exists.
7"$TOP/utils/set-local-config" --bundle lp-db
8
9exit 0
diff --git a/lp-db/qastaging/extra_pg.conf b/lp-db/qastaging/extra_pg.conf
0new file mode 10064410new file mode 100644
index 0000000..bfda731
--- /dev/null
+++ b/lp-db/qastaging/extra_pg.conf
@@ -0,0 +1,30 @@
1autovacuum = True
2autovacuum_analyze_scale_factor = 0.01
3autovacuum_analyze_threshold = 50
4autovacuum_vacuum_cost_delay = -1 # RT#130656
5autovacuum_vacuum_scale_factor = 0.05
6datestyle = 'iso, mdy'
7default_statistics_target = 500
8effective_cache_size = 150GB
9fsync = True
10full_page_writes = True
11hot_standby_feedback = True
12log_autovacuum_min_duration = 0
13log_destination = 'stderr'
14log_lock_waits = True
15log_min_duration_statement = 10000
16log_temp_files = 20MB
17log_timezone = UTC
18maintenance_work_mem = 1GB
19max_connections = 4250
20max_prepared_transactions = 0
21max_wal_size = 256MB
22random_page_cost = 1.2
23search_path = '"$user",public'
24shared_buffers = 8GB
25standard_conforming_strings = False
26synchronous_commit = on
27temp_buffers = 1MB
28wal_keep_segments = 10000
29wal_level = replica
30work_mem = 20MB
diff --git a/lp-db/qastaging/pgbouncer_databases.ini b/lp-db/qastaging/pgbouncer_databases.ini
0new file mode 10064431new file mode 100644
index 0000000..a7ea046
--- /dev/null
+++ b/lp-db/qastaging/pgbouncer_databases.ini
@@ -0,0 +1,4 @@
1[databases]
2session_qastaging = dbname=session_qastaging host=database-ps5-1.qastaging.lp.internal port=5432
3launchpad_qastaging = dbname=launchpad_qastaging host=database-ps5-1.qastaging.lp.internal port=5432
4launchpad_qastaging_standby1 = dbname=launchpad_qastaging host=database-ps5-2.qastaging.lp.internal port=5432
diff --git a/lp-db/qastaging/pgbouncer_extra_config.txt b/lp-db/qastaging/pgbouncer_extra_config.txt
0new file mode 1006445new file mode 100644
index 0000000..46d9525
--- /dev/null
+++ b/lp-db/qastaging/pgbouncer_extra_config.txt
@@ -0,0 +1,14 @@
1client_login_timeout = 5
2default_pool_size = 100
3ignore_startup_parameters = application_name
4log_connections = 1
5log_disconnections = 1
6log_pooler_errors = 1
7max_client_conn = 1000
8pool_mode = session
9reserve_pool_size = 10
10reserve_pool_timeout = 3
11server_check_delay = 60
12server_idle_timeout = 30
13stats_users = postgres,nagios,pgbouncer
14tcp_keepalive = 1
diff --git a/lp-db/staging/extra_pg.conf b/lp-db/staging/extra_pg.conf
0new file mode 10064415new file mode 100644
index 0000000..96f3a9f
--- /dev/null
+++ b/lp-db/staging/extra_pg.conf
@@ -0,0 +1,31 @@
1autovacuum = True
2autovacuum_analyze_scale_factor = 0.01
3autovacuum_analyze_threshold = 50
4autovacuum_vacuum_cost_delay = -1 # RT#130656
5autovacuum_vacuum_scale_factor = 0.05
6datestyle = 'iso, mdy'
7default_statistics_target = 500
8effective_cache_size = 150GB
9fsync = True
10full_page_writes = True
11hot_standby_feedback = True
12log_autovacuum_min_duration = 0
13log_destination = 'stderr'
14log_lock_waits = True
15log_min_duration_statement = 10000
16log_temp_files = 20MB
17log_timezone = UTC
18maintenance_work_mem = 1GB
19max_connections = 4250
20max_prepared_transactions = 0
21max_wal_size = 256MB
22random_page_cost = 1.2
23search_path = '"$user",public'
24shared_buffers = 8GB
25standard_conforming_strings = False
26synchronous_commit = on
27temp_buffers = 1MB
28# 320GB! Streaming replication buffer for staging restores.
29wal_keep_segments = 20000
30wal_level = replica
31work_mem = 20MB
diff --git a/lp-db/staging/pgbouncer_databases.ini b/lp-db/staging/pgbouncer_databases.ini
0new file mode 10064432new file mode 100644
index 0000000..956b901
--- /dev/null
+++ b/lp-db/staging/pgbouncer_databases.ini
@@ -0,0 +1,4 @@
1[databases]
2session_staging = dbname=session_staging host=database-ps5-1.staging.lp.internal port=5432
3launchpad_staging = dbname=lpmain_staging host=database-ps5-1.staging.lp.internal port=5432
4launchpad_staging_standby1 = dbname=lpmain_staging host=database-ps5-2.staging.lp.internal port=5432
diff --git a/lp-db/staging/pgbouncer_extra_config.txt b/lp-db/staging/pgbouncer_extra_config.txt
0new file mode 1006445new file mode 100644
index 0000000..46d9525
--- /dev/null
+++ b/lp-db/staging/pgbouncer_extra_config.txt
@@ -0,0 +1,14 @@
1client_login_timeout = 5
2default_pool_size = 100
3ignore_startup_parameters = application_name
4log_connections = 1
5log_disconnections = 1
6log_pooler_errors = 1
7max_client_conn = 1000
8pool_mode = session
9reserve_pool_size = 10
10reserve_pool_timeout = 3
11server_check_delay = 60
12server_idle_timeout = 30
13stats_users = postgres,nagios,pgbouncer
14tcp_keepalive = 1
diff --git a/lp-db/utils b/lp-db/utils
0new file mode 12000015new file mode 120000
index 0000000..468ba70
--- /dev/null
+++ b/lp-db/utils
@@ -0,0 +1 @@
1../utils
0\ No newline at end of file2\ No newline at end of file
diff --git a/lp-db/verify b/lp-db/verify
1new file mode 1007553new file mode 100755
index 0000000..df9e6ef
--- /dev/null
+++ b/lp-db/verify
@@ -0,0 +1,8 @@
1#! /bin/sh
2set -e
3
4TOP="${0%/*}"
5
6export EXTRA_SKIP_CHECKS="check_swap${EXTRA_SKIP_CHECKS:+|${EXTRA_SKIP_CHECKS}}"
7
8exec "$TOP/utils/verify"

Subscribers

People subscribed via source and target branches