Skip to content

Commit f6752e8

Browse files
(PE-40691) docuemnt automated steps for failed postgres and adding compilers
1 parent be0fb06 commit f6752e8

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

documentation/automated_recovery.md renamed to documentation/recovery/automated_recovery.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This procedure uses the following placeholder references.
2828

2929
## Replace failed PE-PostgreSQL server (A or B side)
3030

31-
The procedure for replacing a failed PE-PostgreSQL server is the same regardless of which PE-PostgreSQL server is missing or if the name of the PE-PostgrSQL server is the same or different. This procedure uses the following placeholder references.
31+
The procedure for replacing a failed PE-PostgreSQL server is the same regardless of which PE-PostgreSQL server is missing or if the name of the PE-PostgreSQL server is the same or different. This procedure uses the following placeholder references.
3232

3333
* _\<replacement-postgres-server-fqdn\>_ - The FQDN and certname of the new server being brought in to replace the failed PE-PostgreSQL server
3434
* _\<working-postgres-server-fqdn\>_ - The FQDN and certname of the still-working PE-PostgreSQL server
@@ -38,25 +38,14 @@ The procedure for replacing a failed PE-PostgreSQL server is the same regardless
3838

3939
Procedure:
4040

41-
1. Stop `puppet.service` on Puppet server primary and replica
41+
1. Run the `peadm::replace_failed_postgresql` plan to replace the failed PE-PostgreSQL server:
4242

43-
bolt task run service name=puppet.service action=stop --targets <primary-server-fqdn>,<replica-server-fqdn>
44-
45-
2. Temporarily set both primary and replica server nodes so that they use the remaining healthy PE-PostgreSQL server
46-
47-
bolt plan run peadm::util::update_db_setting --target <primary-server-fqdn>,<replica-server-fqdn> postgresql_host=<working-postgres-server-fqdn> override=true
48-
49-
3. Restart `pe-puppetdb.service` on Puppet server primary and replica
50-
51-
bolt task run service name=pe-puppetdb.service action=restart --targets <primary-server-fqdn>,<replica-server-fqdn>
52-
53-
4. Purge failed PE-PostgreSQL node from PuppetDB
54-
55-
bolt command run "/opt/puppetlabs/bin/puppet node purge <failed-postgres-server-fqdn>" --targets <primary-server-fqdn>
56-
57-
5. Run `peadm::add_database` plan to deploy replacement PE-PostgreSQL server
58-
59-
bolt plan run peadm::add_database -t <replacement-postgres-server-fqdn> primary_host=<primary-server-fqdn>
43+
bolt plan run peadm::replace_failed_postgresql \
44+
primary_host=<primary-server-fqdn> \
45+
replica_host=<replica-server-fqdn> \
46+
working_postgresql_host=<working-postgres-server-fqdn> \
47+
failed_postgresql_host=<failed-postgres-server-fqdn> \
48+
replacement_postgresql_host=<replacement-postgres-server-fqdn>
6049

6150
## Replace failed replica puppet server AND failed replica pe-postgresql server
6251

@@ -71,3 +60,36 @@ This procedure uses the following placeholder references.
7160

7261
2. [Replace failed PE-PostgreSQL server (A or B side)](#replace-failed-pe-postgresql-server-a-or-b-side)
7362
3. [Replace missing or failed replica Puppet server](#replace-missing-or-failed-replica-puppet-server)
63+
64+
## Add or replace compilers
65+
66+
This procedure uses the following placeholder references.
67+
68+
* _\<avail-group-letter\>_ - Either A or B; whichever of the two letter designations the compiler is being assigned to
69+
* _\<compiler-hosts\>_ - A comma-separated list of FQDN and certname of the new compiler(s)
70+
* _\<dns-alt-names\>_ - A comma-separated list of DNS alt names for the compiler
71+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the primary Puppet server
72+
* _\<postgresql-server-fqdn\>_ - The FQDN and certname of the PE-PostgreSQL server with availability group _\<avail-group-letter\>_
73+
74+
Procedure:
75+
76+
1. Run the `peadm::add_compilers` plan to add the compilers:
77+
78+
bolt plan run peadm::add_compilers \
79+
primary_host=<primary-server-fqdn> \
80+
compiler_hosts=<compiler-hosts> \
81+
avail_group_letter=<avail-group-letter> \
82+
dns_alt_names=<dns-alt-names> \
83+
primary_postgresql_host=<postgresql-server-fqdn>
84+
85+
Please note, the optional parameters and values of the plan are as follows.
86+
87+
<!-- table -->
88+
89+
| Parameter | Default value | Description |
90+
| ------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------ |
91+
| `avail_group_letter` | `A` | By default, each compiler will be added to the primary group A. |
92+
| `dns_alt_names` | `undef` | |
93+
| `primary_postgresql_host` | `undef` | By default, this will pre-populate to the required value depending if your architecture contains HA and or external databases. |
94+
95+
For more information around adding compilers to your infrastructure [Expanding Your Deployment](expanding.md#adding-compilers-with-peadmadd_compiler)

documentation/recovery.md renamed to documentation/recovery/recovery.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ These instructions all assume that the failed server is destroyed, and being rep
44

55
The new system needs to be provisioned with the same certificate name as the system it is replacing.
66

7+
Automated procedures are documented in [automated_recovery.md](automated_recovery.md)
8+
79
## Recover from failed primary Puppet server
810

911
1. Promote the replica ([official docs](https://puppet.com/docs/pe/2019.8/dr_configure.html#dr-promote-replica))

0 commit comments

Comments
 (0)