This project aims to bring up a working model of highly available trino clusters via docker with the help of envoy.
-
Start docker daemon within your host
-
Change directory to project root and run
docker-compose up -d
This should bring up the following services:
- envoy
- controlplane
- postgres
- clusterA(coord+workers)
- clusterB(coord+workers)
-
Perform
docker ps
to make sure all services are up -
Setup trino CLI using trino doc given here
-
Connect to trino clusters and fire queries as shown below:
$./trino http://localhost:8090 trino> select * from system.runtime.nodes;
-
Subsequent queries will round robin between clusters clusterA and clusterB
-
Bring down cluster
clusterA
usingdocker-compose stop clusterA-coord
-
Queries will continue to get served from
clusterB
showcasing high availability of clusters as expected -
Bring back
clusterA
withdocker-compose up -d
-
The cluster will automatically get registered on to envoy and start serving queries along with
clusterB