Thank you for reading this post, don't forget to subscribe!
postgres master-slave репликация, база будет в ceph кластере
[codesyntax lang="php" blockstate="collapsed"]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
cat postgres/postgres.yml version: "3.3" services: primary: hostname: 'primary' image: crunchydata/crunchy-postgres:centos7-10.3-1.8.2 environment: - PGHOST=/tmp - MAX_CONNECTIONS=10 - MAX_WAL_SENDERS=5 - PG_MODE=primary - PG_PRIMARY_USER=primaryuser - PG_PRIMARY_PASSWORD=password - PG_DATABASE=testdb - PG_USER=testuser - PG_PASSWORD=password - PG_ROOT_PASSWORD=password - PG_PRIMARY_PORT=5432 volumes: - pg-primary-vol:/pgdata ports: - "5432" networks: - crunchynet deploy: placement: constraints: - node.labels.type == primary - node.role == worker replica: image: crunchydata/crunchy-postgres:centos7-10.3-1.8.2 environment: - PGHOST=/tmp - MAX_CONNECTIONS=10 - MAX_WAL_SENDERS=5 - PG_MODE=replica - PG_PRIMARY_HOST=primary - PG_PRIMARY_PORT=5432 - PG_PRIMARY_USER=primaryuser - PG_PRIMARY_PASSWORD=password - PG_DATABASE=testdb - PG_USER=testuser - PG_PASSWORD=password - PG_ROOT_PASSWORD=password volumes: - pg-replica-vol:/pgdata ports: - "5432" networks: - crunchynet deploy: placement: constraints: - node.labels.type != primary - node.role == worker networks: crunchynet: volumes: pg-primary-vol: driver: "rexray/rbd:latest" driver_opts: size: 6 pg-replica-vol: driver: "rexray/rbd:latest" driver_opts: size: 6 |
[/codesyntax]
на rbd в ceph выделено 6 гигов