Skip to content

Commit c8168e9

Browse files
(PE-40691) document automated steps for failed postgres and adding compilers (#554)
* (PE-40691) docuemnt automated steps for failed postgres and adding compilers * (PE-40691) review updates
1 parent 6eed8e2 commit c8168e9

File tree

4 files changed

+102
-78
lines changed

4 files changed

+102
-78
lines changed

documentation/automated_recovery.md

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Recovery procedures
2+
3+
These instructions provide automated procedures for recovering from select failures of PE components which are managed by PEADM.
4+
5+
Manual procedures are documented in [recovery.md](recovery.md)
6+
7+
## Recover from failed Puppet primary server
8+
9+
1. Promote the replica ([official docs](https://puppet.com/docs/pe/2019.8/dr_configure.html#dr-promote-replica))
10+
2. [Replace missing or failed replica Puppet primary server](#replace-missing-or-failed-replica-puppet-server)
11+
12+
## Replace missing or failed replica Puppet primary server
13+
14+
This procedure uses the following placeholder references.
15+
16+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
17+
* _\<replica-postgres-server-fqdn\>_ - The FQDN and certname of the PE-PostgreSQL server which resides in the same availability group as the replacement replica Puppet primary server
18+
* _\<replacement-replica-fqdn\>_ - The FQDN and certname of the replacement replica Puppet primary server
19+
20+
1. Run `peadm::add_replica` plan to deploy replacement replica Puppet primary server
21+
1. For Standard and Large deployments:
22+
23+
bolt plan run peadm::add_replica primary_host=<primary-server-fqdn> replica_host=<replacement-replica-fqdn>
24+
25+
2. For Extra Large deployments:
26+
27+
bolt plan run peadm::add_replica primary_host=<primary-server-fqdn> replica_host=<replacement-replica-fqdn> replica_postgresql_host=<replica-postgres-server-fqdn>
28+
29+
## Replace failed PE-PostgreSQL server (A or B side)
30+
31+
The procedure for replacing a failed PE-PostgreSQL server is the same regardless of which PE-PostgreSQL server is missing or whether the name of the PE-PostgreSQL server is the same or different. This procedure uses the following placeholder references.
32+
33+
* _\<replacement-postgres-server-fqdn\>_ - The FQDN and certname of the new server being brought in to replace the failed PE-PostgreSQL server
34+
* _\<working-postgres-server-fqdn\>_ - The FQDN and certname of the still-working PE-PostgreSQL server
35+
* _\<failed-postgres-server-fqdn\>_ - The FQDN and certname of the failed PE-PostgreSQL server
36+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
37+
* _\<replica-server-fqdn\>_ - The FQDN and certname of the replica Puppet primary server
38+
39+
Procedure:
40+
41+
1. Run the `peadm::replace_failed_postgresql` plan to replace the failed PE-PostgreSQL server:
42+
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>
49+
50+
## Replace failed replica Puppet primary server AND failed replica PE-PostgreSQL server
51+
52+
This procedure uses the following placeholder references.
53+
54+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
55+
* _\<failed-replica-fqdn\>_ - The FQDN and certname of the failed replica Puppet primary server
56+
57+
1. Ensure the old replica server is forgotten.
58+
59+
bolt command run "/opt/puppetlabs/bin/puppet infrastructure forget <failed-replica-fqdn>" --targets <primary-server-fqdn>
60+
61+
2. [Replace failed PE-PostgreSQL server (A or B side)](#replace-failed-pe-postgresql-server-a-or-b-side)
62+
3. [Replace missing or failed replica Puppet primary 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 Puppet primary 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 on whether 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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ 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-
## Recover from failed primary Puppet server
7+
Automated procedures are documented in [automated_recovery.md](automated_recovery.md)
8+
9+
## Recover from failed Puppet primary server
810

911
1. Promote the replica ([official docs](https://puppet.com/docs/pe/2019.8/dr_configure.html#dr-promote-replica))
1012
2. Purge the failed primary server
@@ -18,7 +20,7 @@ The new system needs to be provisioned with the same certificate name as the sys
1820

1921
This procedure uses the following placeholder references.
2022

21-
* _\<primary-server-fqdn\>_ - The FQDN and certname of the primary Puppet server
23+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
2224
* _\<old-replica-fqdn\>_ - The FQDN and certname of the old replica Puppet server that has failed or is missing
2325
* _\<replacement-replica-fqdn\>_ - The FQDN and certname of the new replica Puppet server
2426
* _\<replacement-avail-group-letter\>_ - Either A or B; whichever of the two letter designations is appropriate for the replacement server. It will be the opposite of the primary server.
@@ -81,7 +83,7 @@ The procedure for replacing a failed PE-PostgreSQL server is the same regardless
8183
* _\<replacement-postgres-server-fqdn\>_ - The FQDN and certname of the new server being brought in to replace the failed PE-PostgreSQL server
8284
* _\<working-postgres-server-fqdn\>_ - The FQDN and certname of the still-working PE-PostgreSQL server
8385
* _\<replacement-avail-group-letter\>_ - Either A or B; whichever of the two letter designations is appropriate for the server being replaced. It will be the opposite of the still-working PE-PostgreSQL server
84-
* _\<primary-server-fqdn\>_ - The FQDN and certname of the primary Puppet server
86+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
8587

8688
Procedure:
8789

@@ -200,7 +202,7 @@ This procedure uses the following placeholder references.
200202
* _\<avail-group-letter\>_ - Either A or B; whichever of the two letter designations the compiler is being assigned to
201203
* _\<new-compiler-fqdn\>_ - The FQDN and certname of the new compiler
202204
* _\<dns-alt-names\>_ - A comma-separated list of DNS alt names for the compiler
203-
* _\<primary-server-fqdn\>_ - The FQDN and certname of the primary Puppet server
205+
* _\<primary-server-fqdn\>_ - The FQDN and certname of the Puppet primary server
204206
* _\<postgresql-server-fqdn\>_ - The FQDN and certname of the PE-PostgreSQL server with availability group _\<avail-group-letter\>_
205207

206208
1. On _\<postgresql-server-fqdn\>_:

manifests/setup/legacy_compiler_group.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@
6767
}
6868

6969
node_group { 'PE Compiler':
70-
rule => ['and', ['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'false']],
70+
rule => ['and', ['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'false']],
7171
}
7272
}

0 commit comments

Comments
 (0)