docker
docker copied to clipboard
How to deploy a horizontally scalable cluster?
After reading the introduction, we found that citus perfectly met our requirements, but the deployment documentation was unfriendly. How to deploy a horizontally scalable cluster?
Eg in Node 1 of 192.168.1.1
service:
master1:
image:citusdata/citus:12.1
ports:
- 5432:5432
volumes:
- ./data1:/data
environment:
- CITUS_CLUSTER: 192.168.1.2,182.168.1.3
Eg in Node 1 of 192.168.1.2
service:
master2:
image:citusdata/citus:12.1
ports:
- 5432:5432
volumes:
- ./data2:/data
environment:
- CITUS_CLUSTER: 192.168.1.1,182.168.1.3
Eg in Node 1 of 192.168.1.3
service:
master3:
image:citusdata/citus:12.1
ports:
- 5432:5432
volumes:
- ./data3:/data
environment:
- CITUS_CLUSTER: 192.168.1.1,182.168.1.2
And users can connect to any node.
- 192.168.1.1:5432
- 192.168.1.2:5432
- 192.168.1.3:5432
Referenced from the MinIO cluster https://github.com/minio/minio/blob/master/docs/orchestration/docker-compose/docker-compose.yaml
I'm not sure if my understanding is wrong, but if citus can support such horizontal scalability and it can still work when a certain node fails, then it will be very powerful.