|  | 
|  | 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 server](#replace-missing-or-failed-replica-puppet-server) | 
|  | 11 | + | 
|  | 12 | +## Replace missing or failed replica Puppet 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 server | 
|  | 18 | +* _\<replacement-replica-fqdn\>_ - The FQDN and certname of the replacement replica Puppet server | 
|  | 19 | + | 
|  | 20 | +1. Run `peadm::add_replica` plan to deploy replacement replica Puppet 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 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 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 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 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) | 
0 commit comments