Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbook #163
@ -1,36 +1,20 @@
|
||||
# kosmos-postgresql
|
||||
|
||||
## Custom resources
|
||||
## Usage
|
||||
|
||||
### `postgresql_custom_server`
|
||||
### On the primary:
|
||||
|
|
||||
|
||||
Usage:
|
||||
Set the `postgresql_primary` role on the node
|
||||
|
||||
(`node['fqdn']`, for example `andromeda.kosmos.org`) is generated using Let's
|
||||
Encrypt and copied to the PostgreSQL data directory and added to the
|
||||
`postgresql.conf` file
|
||||
|
||||
#### On the primary:
|
||||
|
||||
```ruby
|
||||
postgresql_custom_server "12" do
|
||||
role "primary"
|
||||
end
|
||||
```
|
||||
|
||||
#### On a replica:
|
||||
|
||||
```ruby
|
||||
postgresql_custom_server "12" do
|
||||
role "replica"
|
||||
end
|
||||
```
|
||||
### On the replica:
|
||||
|
||||
Add the `postgresql_replica` role to the node's run list. Run Chef on the node
|
||||
a first time.
|
||||
After the initial Chef run on the replica, run Chef on the primary to add the
|
||||
firewall rules and PostgreSQL access rules, then run Chef again on the replica
|
||||
to set up replication.
|
||||
|
||||
#### Caveat
|
||||
## Caveat
|
||||
|
||||
[`firewall_rules`](https://github.com/chef-cookbooks/firewall/issues/134) and
|
||||
[`postgresql_access`](https://github.com/sous-chefs/postgresql/issues/648) are
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user
What's "custom" about these servers? If "custom" merely means that it's going to be configured for our use case, then isn't that the case for literally every other server, too?
They're Chef custom resources (https://docs.chef.io/custom_resources/), the concept that replaces LWRP (https://chef.readthedocs.io/en/latest/lwrps_custom.html)