zalando / patroni

A template for PostgreSQL High Availability with Etcd, Consul, ZooKeeper, or Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need Help in Setting up docker-compose-citus.yaml

dotsinspace opened this issue · comments

What happened?

😞 SORRY I HAVE REACHED THE SLACK but didn't already didn't found out any single explaination..so in desperation i am writing my question as BUG.

❤️ Thank your lovely Patroni. Can any help me to customize docker-compose-citus file in repo itself with following doubts.

  1. How can i remove ssl or add my own ssl certificate.
  2. I encountered one wired issue ( Last time i run docker-compose up ) patroni spinned and everything worked smoothly but i lost all data on docker restart. how can i avoid it.
  3. How can check number of connection citus docker can handle.

( I have purchased a medium server for specifically HA Postgres ) with following configuration.
32 GB Ram, 500SSD, 8vCPu...but i can't understand how can i commit connection limit to someone if i use it.

  1. I know there are lot of docs over the web for Patroni and its setup...but all of them are talking about Patroni setup using patroni ctl but i want docker compose to do everything. is there any reference which can teach me patroni repo setup and itself deep detailed working.

  2. Current Setup require SSH. How can i make it in such a way that connection is secure and sslmode is in require. which i can use directly as connection string. Because Prisma.io doesn't support SSH and Prisma is one tool which i am using from day it was born. but some one Prisma is unable to connection throwing permission denied. but when i SSH using datagrip then i am able to use DB.

Regards

How can we reproduce it (as minimally and precisely as possible)?

What did you expect to happen?

Patroni/PostgreSQL/DCS version

  • Patroni version:
  • PostgreSQL version:
  • DCS (and its version):

Patroni configuration file

# docker compose file for running a Citus cluster
# with 3-node etcd v3 cluster as the DCS and one haproxy node.
# The Citus cluster has a coordinator (3 nodes)
# and two worker clusters (2 nodes).
#
# Before starting it up you need to build the docker image:
# $ docker build -f Dockerfile.citus -t patroni-citus .
# The cluster could be started as:
# $ docker-compose -f docker-compose-citus.yml up -d
# You can read more about it in the:
# https://github.com/zalando/patroni/blob/master/docker/README.md#citus-cluster
version: "2"

networks:
    demo:

services:
    etcd1: &etcd
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        environment:
            ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
            ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
            ETCD_INITIAL_CLUSTER: etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
            ETCD_INITIAL_CLUSTER_STATE: new
            ETCD_INITIAL_CLUSTER_TOKEN: tutorial
            ETCD_UNSUPPORTED_ARCH: arm64
        container_name: demo-etcd1
        hostname: etcd1
        command: etcd --name etcd1 --initial-advertise-peer-urls http://etcd1:2380

    etcd2:
        <<: *etcd
        container_name: demo-etcd2
        hostname: etcd2
        command: etcd --name etcd2 --initial-advertise-peer-urls http://etcd2:2380

    etcd3:
        <<: *etcd
        container_name: demo-etcd3
        hostname: etcd3
        command: etcd --name etcd3 --initial-advertise-peer-urls http://etcd3:2380

    haproxy:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: haproxy
        container_name: demo-haproxy
        ports:
            - "5000:5000"  # Access to the coorinator primary
            - "5001:5001"  # Load-balancing across workers primaries
        command: haproxy
        environment: &haproxy_env
            ETCDCTL_ENDPOINTS: http://etcd1:2379,http://etcd2:2379,http://etcd3:2379
            PATRONI_ETCD3_HOSTS: "'etcd1:2379','etcd2:2379','etcd3:2379'"
            PATRONI_SCOPE: demo
            PATRONI_CITUS_GROUP: 0
            PATRONI_CITUS_DATABASE: smsflash
            PGSSLMODE: verify-ca
            PGSSLKEY: /etc/ssl/private/ssl-cert-snakeoil.key
            PGSSLCERT: /etc/ssl/certs/ssl-cert-snakeoil.pem
            PGSSLROOTCERT: /etc/ssl/certs/ssl-cert-snakeoil.pem

    coord1:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: coord1
        container_name: demo-coord1
        environment: &coord_env
            <<: *haproxy_env
            PATRONI_NAME: coord1
            PATRONI_CITUS_GROUP: 0

    coord2:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: coord2
        container_name: demo-coord2
        environment:
            <<: *coord_env
            PATRONI_NAME: coord2

    coord3:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: coord3
        container_name: demo-coord3
        environment:
            <<: *coord_env
            PATRONI_NAME: coord3


    work1-1:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: work1-1
        container_name: demo-work1-1
        environment: &work1_env
            <<: *haproxy_env
            PATRONI_NAME: work1-1
            PATRONI_CITUS_GROUP: 1

    work1-2:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: work1-2
        container_name: demo-work1-2
        environment:
            <<: *work1_env
            PATRONI_NAME: work1-2


    work2-1:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: work2-1
        container_name: demo-work2-1
        environment: &work2_env
            <<: *haproxy_env
            PATRONI_NAME: work2-1
            PATRONI_CITUS_GROUP: 2

    work2-2:
        image: ${PATRONI_TEST_IMAGE:-patroni-citus}
        networks: [ demo ]
        env_file: docker/patroni.env
        hostname: work2-2
        container_name: demo-work2-2
        environment:
            <<: *work2_env
            PATRONI_NAME: work2-2

patronictl show-config

-

Patroni log files

-

PostgreSQL log files

-

Have you tried to use GitHub issue search?

  • Yes

Anything else we need to know?

No

  1. docker-compose-citus.yml is not for production, it is just to try it out locally.
  2. How you deploy/manage Patroni in your environment is outside of scope of Patroni issues.
  3. Issues are for real issues, e.g. bugs
  4. Please use Slack, maybe someone will help.

Tried...can you help me build docker compose citus for production use. and what are the reasons to not use it?