标签:rarp ase 测试 数据 serve lin div border ice
patroni 是一个很不错的pg ha 解决方案,graphql-engine 是一个很好的graphql 工具,为了方便使用
参考patroni官方的文档,使用docker-compose 将应用集成在一起,方便进行测试
github 代码 https://github.com/rongfengliang/graphql-engine-patroni
version: "3"
services:
patroni_etcd:
container_name: patroni_etcd
image: dalongrong/patroni
command: --etcd
dbnode1:
image: dalongrong/patroni
hostname: dbnode1
ports:
- "5432:5432"
- "8008:8008"
links:
- patroni_etcd:patroni_etcd
volumes:
- ./patroni:/patroni
env_file: docker/patroni-secrets.env
environment:
PATRONI_ETCD_URL: http://patroni_etcd:2379
PATRONI_NAME: dbnode1
PATRONI_SCOPE: testcluster
dbnode2:
image: dalongrong/patroni
hostname: dbnode2
ports:
- "5433:5432"
- "8009:8008"
links:
- patroni_etcd:patroni_etcd
volumes:
- ./patroni:/patroni
env_file: docker/patroni-secrets.env
environment:
PATRONI_ETCD_URL: http://patroni_etcd:2379
PATRONI_NAME: dbnode2
PATRONI_SCOPE: testcluster
dbnode3:
image: dalongrong/patroni
hostname: dbnode3
ports:
- "5434:5432"
- "8010:8008"
links:
- patroni_etcd:patroni_etcd
volumes:
- ./patroni:/patroni
env_file: docker/patroni-secrets.env
environment:
PATRONI_ETCD_URL: http://patroni_etcd:2379
PATRONI_NAME: dbnode3
PATRONI_SCOPE: testcluster
haproxy:
image: dalongrong/patroni
links:
- patroni_etcd:patroni_etcd
ports:
- "5000:5000"
- "5001:5001"
- "7000:7000"
environment:
PATRONI_ETCD_URL: http://patroni_etcd:2379
PATRONI_SCOPE: testcluster
command: --confd
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha30
ports:
- "8080:8080"
environment:
- "POSTGRES_PASSWORD:postgres"
command: >
/bin/sh -c "
graphql-engine --database-url postgres://postgres:postgres@haproxy:5000/postgres serve --enable-console;
"
docker-compose up -d
docker-compose stop dbnode3
重新启动3
从haproxy的界面可以看出,会有一个选举的过程,但是还是很不错的,都是自动的
docker-compose start dbnode3
master rest 接口的信息
https://github.com/rongfengliang/patroni
https://github.com/zalando/patroni
https://github.com/rongfengliang/graphql-engine-patroni
https://github.com/hasura/graphql-engine
https://docs.hasura.io/1.0/graphql/manual/index.html
hasura graphql-engine &&patroni docker-compose 环境运行
标签:rarp ase 测试 数据 serve lin div border ice
原文地址:https://www.cnblogs.com/rongfengliang/p/10058996.html