Skip to content

Commit 9ed573e

Browse files
authored
Post-review updates to recovery.md
Updates to draft following engineer review
1 parent ef85494 commit 9ed573e

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

documentation/recovery.md

+24-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ The new system needs to be provisioned with the same certificate name as the sys
77
## Recover from failed primary Puppet server
88

99
1. Promote the replica ([official docs](https://puppet.com/docs/pe/2019.8/dr_configure.html#dr-promote-replica))
10-
2. Replace missing replica server (same as [Replace missing or failed replica Puppet server](#replace-missing-or-failed-replica-puppet-server) below)
10+
2. Purge the failed primary server
11+
12+
puppet node purge <failed-primary-server-fqdn>
13+
14+
15+
3. Replace missing replica server (same as [Replace missing or failed replica Puppet server](#replace-missing-or-failed-replica-puppet-server) below)
1116

1217
## Replace missing or failed replica Puppet server
1318

@@ -16,20 +21,13 @@ This procedure uses the following placeholder references.
1621
* _\<primary-server-fqdn\>_ - The FQDN and certname of the primary Puppet server
1722
* _\<old-replica-fqdn\>_ - The FQDN and certname of the old replica Puppet server that has failed or is missing
1823
* _\<replacement-replica-fqdn\>_ - The FQDN and certname of the new replica Puppet server
19-
* _\<failed-primary-server-fqdn\>_ - The FQDN and certname of the original primary server that the old replica had replaced
20-
* _\<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 server that it is replacing.
21-
22-
1. If applicable, purge the failed primary server. (You may need to do this, for example, if the original primary failed and the promoted replica that replaced it has also failed.)
23-
24-
puppet node purge <failed-primary-server-fqdn>
24+
* _\<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.
2525

26-
2. Ensure the old replica server is forgotten.
26+
1. Ensure the old replica server is forgotten.
2727

2828
puppet infrastructure forget <old-replica-fqdn>
2929

30-
3. Install the Puppet agent on the replacement replica.
31-
32-
**Note**: When designating the availability group of the replacement, use the opposite group (A or B) of the server being replaced. This means that, if the old replica server replaced the original primary server, the new replica is assigned the same availability group as the original primary.
30+
2. Install the Puppet agent on the replacement replica.
3331

3432
curl -k https://<primary-server-fqdn>:8140/packages/current/install.bash \
3533
| bash -s -- \
@@ -41,18 +39,23 @@ This procedure uses the following placeholder references.
4139

4240
puppet agent -t
4341

44-
4. Sign the certificate on the new primary server.
42+
3. Sign the certificate on the primary server.
43+
44+
puppetserver ca sign --certname
4545

46-
5. On the PE-PostgreSQL server in the _\<replacement-avail-group-letter\>_ group
46+
4. On the PE-PostgreSQL server in the _\<replacement-avail-group-letter\>_ group
4747
1. Stop puppet.service
4848

4949
puppet resource service puppet ensure=stopped
5050
51-
3. Add the following two lines to /opt/puppetlabs/server/data/postgresql/14/data/pg\_ident.conf
51+
3. Add the following two lines to /opt/puppetlabs/server/data/postgresql/_<postgres_version>_/data/pg_ident.conf
52+
53+
where _<postgres_version>_ is the appropriate major version of PostgreSQL as detailed in [Component versions in recent PE releases](https://www.puppet.com/docs/pe/2023.8/component_versions_in_recent_pe_releases.html#pe-agent-server-components). For PE release 2023.8.0 the PostgreSQL version is 14.
5254

5355
pe-puppetdb-pe-puppetdb-map <replacement-replica-fqdn> pe-puppetdb
5456
pe-puppetdb-pe-puppetdb-migrator-map <replacement-replica-fqdn> pe-puppetdb-migrator
5557

58+
5659
5. Restart pe-postgresql.service
5760

5861
puppet resource service pe-postgresql ensure=stopped
@@ -62,11 +65,11 @@ This procedure uses the following placeholder references.
6265

6366
puppet agent -t
6467

65-
6. Provision the new system as a replica
68+
5. Provision the new system as a replica
6669

6770
puppet infrastructure provision replica <replacement-replica-fqdn> --topology mono-with-compile --skip-agent-config --enable
6871

69-
7. On the PE-PostgreSQL server in the _\<replacement-avail-group-letter\>_ group, start puppet.service
72+
6. On the PE-PostgreSQL server in the _\<replacement-avail-group-letter\>_ group, start puppet.service
7073

7174
puppet resource service puppet ensure=running
7275

@@ -128,11 +131,13 @@ On _\<working-postgres-server-fqdn\>_:
128131

129132
systemctl stop puppet
130133

131-
2. Add this line to /opt/puppetlabs/server/data/postgresql/14/data/pg\_ident.conf
134+
2. Add this line to /opt/puppetlabs/server/data/postgresql/_<postgres_version>_/data/pg_ident.conf
135+
136+
where _<postgres_version>_ is the appropriate major version of PostgreSQL as detailed in [Component versions in recent PE releases](https://www.puppet.com/docs/pe/2023.8/component_versions_in_recent_pe_releases.html#pe-agent-server-components). For PE release 2023.8.0 the PostgreSQL version is 14.
132137

133138
replication-pe-ha-replication-map <replacement-postgres-server-fqdn> pe-ha-replication
134139

135-
3. Add these lines to /opt/puppetlabs/server/data/postgresql/14/data/pg\_hba.conf
140+
3. Add these lines to /opt/puppetlabs/server/data/postgresql/_<postgres_version>_/data/pg\_hba.conf
136141

137142
# REPLICATION RESTORE PERMISSIONS
138143
hostssl replication pe-ha-replication 0.0.0.0/0 cert map=replication-pe-ha-replication-map clientcert=1
@@ -144,7 +149,7 @@ On _\<working-postgres-server-fqdn\>_:
144149

145150
On _\<replacement-postgres-server-fqdn\>_:
146151

147-
Run the following commands.
152+
Run the following commands (using the appropriate PostgreSQL version number)
148153

149154
```
150155
systemctl stop puppet.service pe-postgresql.service

0 commit comments

Comments
 (0)