Upgrade Stolon doc

This commit is contained in:
Quentin 2022-08-24 17:09:28 +02:00
parent 18610f9a9a
commit ed82071223
Signed by: quentin
GPG key ID: E9602264D639FF68
2 changed files with 25 additions and 10 deletions

View file

@ -99,7 +99,7 @@ services:
# https://github.com/sorintlab/stolon/releases # https://github.com/sorintlab/stolon/releases
STOLON_VERSION: 3bb7499f815f77140551eb762b200cf4557f57d3 STOLON_VERSION: 3bb7499f815f77140551eb762b200cf4557f57d3
context: ./postgres/build/postgres context: ./postgres/build/postgres
image: superboum/amd64_postgres:v10 image: superboum/amd64_postgres:v11
backup-consul: backup-consul:
build: build:

View file

@ -1,9 +1,12 @@
Spawn container: Spawn container:
```bash ```bash
docker run -t -i superboum/arm32v7_postgres:v6 docker run \
# OR -ti --rm \
docker run -t -i superboum/amd64_postgres:v1 --name stolon-config \
--user root \
-v /var/lib/consul/pki/:/certs \
superboum/amd64_postgres:v11
``` ```
@ -11,18 +14,30 @@ Init with:
``` ```
stolonctl \ stolonctl \
--cluster-name pissenlit \ --cluster-name chelidoine \
--store-backend=consul \ --store-backend=consul \
--store-endpoints http://consul.service.2.cluster.deuxfleurs.fr:8500 \ --store-endpoints https://consul.service.prod.consul:8501 \
--store-ca-file /certs/consul-ca.crt \
--store-cert-file /certs/consul2022-client.crt \
--store-key /certs/consul2022-client.key \
init \ init \
'{ "initMode": "new", "pgHBA": [ "host all postgres all md5", "host replication replicator all md5", "host all all all ldap ldapserver=bottin.service.2.cluster.deuxfleurs.fr ldapbasedn=\"ou=users,dc=deuxfleurs, dc=fr\" ldapbinddn=\"<bind_dn>\" ldapbindpasswd=\"<bind_pwd>\" ldapsearchattribute=\"cn\"" ] }' '{ "initMode": "new",
"usePgrewind" : true,
"proxyTimeout" : "120s",
"pgHBA": [
"host all postgres all md5",
"host replication replicator all md5",
"host all all all ldap ldapserver=bottin.service.prod.consul ldapbasedn=\"ou=users,dc=deuxfleurs, dc=fr\" ldapbinddn=\"<bind_dn>\" ldapbindpasswd=\"<bind_pwd>\" ldapsearchattribute=\"cn\""
]
}'
``` ```
Then set appropriate permission on host: Then set appropriate permission on host:
``` ```
chown -R 102:102 /mnt/storage/postgres/ mkdir -p /mnt/{ssd,storage}/postgres/
chown -R 999:999 /mnt/{ssd,storage}/postgres/
``` ```
(102 is the id of the postgres user used in Docker) (102 is the id of the postgres user used in Docker)
@ -33,10 +48,10 @@ Moreover it would enable the usage of the user namespace that shift the UIDs.
## Upgrading the cluster ## Upgrading the cluster
To retreive the current stolon config: To retrieve the current stolon config:
``` ```
stolonctl spec --cluster-name pissenlit --store-backend consul --store-endpoints http://consul.service.2.cluster.deuxfleurs.fr:8500 stolonctl spec --cluster-name chelidoine --store-backend consul --store-ca-file ... --store-cert-file ... --store-endpoints https://consul.service.prod.consul:8501
``` ```
The important part for the LDAP: The important part for the LDAP: