Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbook #163
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/160-postgres_replication"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See the README in the kosmos-postgresql cookbook (
site-cookbooks/kosmos-postgresql/README.md
) for docs about the custom resource. For replication, Chef needs to run once on the replica, then once on the primary to set up the access rules, and then a second time on the replicaAlso upgrade PostgreSQL from 10 to 12 (10 is the version running on andromeda right now)
Refs #160
I glanced over everything and added a few comments to the mentioned README.
@ -3,2 +3,3 @@
TODO: Enter the cookbook description here.
## Custom resources
### `postgresql_custom_server`
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)
@ -5,0 +24,4 @@
```ruby
postgresql_custom_server "12" do
role "primary"
The replica also needs to have "primary" as role?
Thanks, I've pushed a fix for the typo
@ -5,0 +38,4 @@
[`firewall_rules`](https://github.com/chef-cookbooks/firewall/issues/134) and
[`postgresql_access`](https://github.com/sous-chefs/postgresql/issues/648) need
to be declared in recipes, not resources because of the way custom resources
work currently in Chef
Which rules are needed? How are they declared? I believe this README would not answer these questions for someone trying to use it.
Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbookto WIP: Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbookWIP: Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbookto Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbookLeft a couple of comments/questions.
@ -5,0 +57,4 @@
the PostgreSQL server.
The root certificate needs to be deployed to clients so they verify the cert
can be trusted.
I don't see where that's done in this PR?
I forgot to remove that part from the README, as we said in #160 that we don't care about verifying the root cert. It would be done in the cookbooks for software that connects to PostgreSQL (together with creating databases) and not in this cookbook
@ -51,1 +73,4 @@
end
# TODO: We need to set up firewall rules and access rules for clients too
# (Mastodon, ejabberd, etc)
What does this mean? Why would they use a different port to connect to Postgres?
I'm removing that line, this will be done as part of the Mastodon, ejabberd, gitea cookbooks. They wouldn't use a different port, but clients still need access for the specific database, user and IP (https://www.postgresql.org/docs/12/auth-pg-hba-conf.html)