129 lines
3.6 KiB
YAML
129 lines
3.6 KiB
YAML
x-etcd: &etcd
|
|
image: quay.io/coreos/etcd:v3.6.5
|
|
entrypoint: /usr/local/bin/etcd
|
|
mem_limit: 128m
|
|
volumes:
|
|
- /etcd-data
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
x-etcd-env: &etcd-env
|
|
ETCD_DATA_DIR: /etcd-data
|
|
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
|
|
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
|
|
ETCD_INITIAL_CLUSTER: etcd-a=http://etcd-a:2380,etcd-b=http://etcd-b:2380,etcd-c=http://etcd-c:2380
|
|
ETCD_INITIAL_CLUSTER_TOKEN: objectstore-disposable-ha-test
|
|
ETCD_INITIAL_CLUSTER_STATE: new
|
|
ETCD_QUOTA_BACKEND_BYTES: "33554432"
|
|
ETCD_MAX_WALS: "2"
|
|
ETCD_MAX_SNAPSHOTS: "2"
|
|
ETCD_LOG_LEVEL: warn
|
|
|
|
x-postgres: &postgres
|
|
image: objectstore-ha-postgres:local
|
|
build: .
|
|
mem_limit: 256m
|
|
volumes:
|
|
- /var/lib/postgresql/data
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
depends_on:
|
|
- etcd-a
|
|
- etcd-b
|
|
- etcd-c
|
|
|
|
x-node: &node
|
|
image: ${OBJECTSTORE_HA_IMAGE:-objectstore-ha-test:local}
|
|
entrypoint: [java, -Xmx96m, --add-modules, "jdk.httpserver,java.net.http", -cp, /app:/app/postgresql.jar:/app/hash4j.jar, cloud.lunarsky.store.ClusterNode]
|
|
mem_limit: 160m
|
|
environment:
|
|
CLUSTER_TOKEN: ha-test-cluster-token-012345678901234567
|
|
CLUSTER_REPAIR_TOKEN: ha-test-repair-token-012345678901234567
|
|
CLUSTER_HOST_ID: 82ae31fb-522e-40c6-ac78-aa1c003f9a18
|
|
DATA_DIR: /data
|
|
NODE_BIND: 0.0.0.0
|
|
volumes:
|
|
- /data
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9100/health"]
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 30
|
|
|
|
services:
|
|
etcd-a:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *etcd-env
|
|
ETCD_NAME: etcd-a
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd-a:2379
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd-a:2380
|
|
etcd-b:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *etcd-env
|
|
ETCD_NAME: etcd-b
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd-b:2379
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd-b:2380
|
|
etcd-c:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *etcd-env
|
|
ETCD_NAME: etcd-c
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd-c:2379
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd-c:2380
|
|
db-a:
|
|
<<: *postgres
|
|
environment:
|
|
PATRONI_NAME: db-a
|
|
PATRONI_POSTGRESQL_CONNECT_ADDRESS: db-a:5432
|
|
PATRONI_RESTAPI_CONNECT_ADDRESS: db-a:8008
|
|
db-b:
|
|
<<: *postgres
|
|
environment:
|
|
PATRONI_NAME: db-b
|
|
PATRONI_POSTGRESQL_CONNECT_ADDRESS: db-b:5432
|
|
PATRONI_RESTAPI_CONNECT_ADDRESS: db-b:8008
|
|
db-c:
|
|
<<: *postgres
|
|
environment:
|
|
PATRONI_NAME: db-c
|
|
PATRONI_POSTGRESQL_CONNECT_ADDRESS: db-c:5432
|
|
PATRONI_RESTAPI_CONNECT_ADDRESS: db-c:8008
|
|
node-a:
|
|
<<: *node
|
|
node-b:
|
|
<<: *node
|
|
gateway:
|
|
image: ${OBJECTSTORE_HA_IMAGE:-objectstore-ha-test:local}
|
|
mem_limit: 256m
|
|
environment:
|
|
STORE_MODE: cluster
|
|
CLUSTER_LOCAL_DEV: "true"
|
|
CLUSTER_TEST_NODE_DOMAINS: "true"
|
|
CLUSTER_NODES: http://node-a:9100,http://node-b:9100
|
|
CLUSTER_TOKEN: ha-test-cluster-token-012345678901234567
|
|
POSTGRES_JDBC_URL: jdbc:postgresql://db-a:5432,db-b:5432,db-c:5432/objectstore?targetServerType=primary&connectTimeout=1&socketTimeout=5&hostRecheckSeconds=0
|
|
POSTGRES_USER: objectstore
|
|
POSTGRES_PASSWORD: ha-test-database-password
|
|
S3_ACCESS_KEY: HaTestAccessKey0001
|
|
S3_SECRET_KEY: ha-test-s3-secret-01234567890123456789
|
|
S3_BUCKET: ha-test
|
|
MAX_OBJECT_BYTES: "1048576"
|
|
MAX_TOTAL_BYTES: "16777216"
|
|
BIND_ADDRESS: 0.0.0.0
|
|
ports:
|
|
- "127.0.0.1::9000"
|
|
networks:
|
|
- default
|
|
- client
|
|
depends_on:
|
|
node-a:
|
|
condition: service_healthy
|
|
node-b:
|
|
condition: service_healthy
|
|
networks:
|
|
default:
|
|
internal: true
|
|
client: {}
|