db-koji02: create vm and config files for hot standby kojidb.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2019-10-17 19:01:50 +00:00 committed by Pierre-Yves Chibon
parent f01ae28b8c
commit 9747e55c72
5 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,49 @@
---
nm: 255.255.255.0
gw: 10.5.125.254
dns: 10.5.126.21
volgroup: /dev/vg_guests
eth0_ip: 10.5.125.48
vmhost: bvirthost12.phx2.fedoraproject.org
datacenter: phx2
ks_url: http://infrastructure.phx2.fedoraproject.org/repo/rhel/ks/kvm-rhel-7
ks_repo: http://infrastructure.phx2.fedoraproject.org/repo/rhel/RHEL7-x86_64/
# This is a generic list, monitored by collectd
databases:
- koji
# This is a more strict list, to be made publicly available
dbs_to_backup:
- koji
# These are normally group variables, but in this case db servers are often different
lvm_size: 300000
mem_size: 32768
num_cpus: 24
fas_client_groups: sysadmin-dba,sysadmin-noc,sysadmin-veteran
# kernel SHMMAX value
kernel_shmmax: 68719476736
#
# Only allow postgresql access from the frontend node.
#
custom_rules: [
'-A INPUT -p tcp -m tcp -s 10.5.125.59 --dport 5432 -j ACCEPT',
'-A INPUT -p tcp -m tcp -s 10.5.125.60 --dport 5432 -j ACCEPT',
'-A INPUT -p tcp -m tcp -s 10.5.125.61 --dport 5432 -j ACCEPT',
'-A INPUT -p tcp -m tcp -s 10.5.125.62 --dport 5432 -j ACCEPT',
'-A INPUT -p tcp -m tcp -s 10.5.126.41 --dport 5432 -j ACCEPT',
]
#
# Large updates pushes cause lots of db threads doing the tag moves, so up this from default.
#
nrpe_procs_warn: 600
nrpe_procs_crit: 700
db_backup_dir: ['/backups']
shared_buffers: "8GB"
effective_cache_size: "24GB"

View file

@ -293,6 +293,7 @@ db03.phx2.fedoraproject.org
db-fas01.phx2.fedoraproject.org
db-datanommer02.phx2.fedoraproject.org
db-koji01.phx2.fedoraproject.org
db-koji02.phx2.fedoraproject.org
db-qa01.qa.fedoraproject.org
db-qa02.qa.fedoraproject.org
db-qa03.qa.fedoraproject.org

View file

@ -90,13 +90,24 @@
- config
- postgresql
- name: postgresql recover.conf template (standby only)
template: dest=/var/lib/pgsql/data/resovery.conf src=recovery.conf
when: inventory_hostname.startswith('db-koji02')
notify:
- restart postgresql
tags:
- config
- postgresql
- name: Ensure postgres has a place to backup to
file: dest=/backups state=directory owner=postgres
when: inventory_hostname.startswith('db-koji02')
tags:
- postgresql
- name: Copy over backup scriplet
copy: src=backup-database dest=/usr/local/bin/backup-database mode=0755
when: inventory_hostname.startswith('db-koji02')
tags:
- postgresql

View file

@ -505,3 +505,11 @@ default_text_search_config = 'pg_catalog.english'
#
# Number of concurrent i/o operations at the same time. The default is 1.
effective_io_concurrency = 1
{% if ansible_hostname.startswith("db-koji01") %}
wal_level = 'hot_standby'
max_wal_senders = 10
wal_keep_segments = 100
{% elif ansible_hostname.startswith("db-koji02") %}
hot_standby = on
{% endif %}

View file

@ -0,0 +1,3 @@
standby_mode = 'on'
primary_conninfo = 'host=10.5.125.48 port=5432 user=replication password={{ koji_db_replication_password }}
trigger_file= '/var/lib/pgsql/trigger_file'