Note: this app requires version 0.0.223 or greater of the Fly CLI. Run
flyctl version update
before you follow these instructions.
This is an example CockroachDB cluster that runs on multiple Fly.io regions.
Deploying this app is relatively simple:
- Clone this repository
- Install the
fly
CLI - Run
fly launch
.- Pick "yes" to copy existing configuration
- When it asks if you want to deploy, say no
- Create volumes:
# one in Chicago fly volumes create cdb_data --region ord --size 10 # one in Paris fly volumes create cdb_data --region cdg --size 10 # one in Singapore fly volumes create cdb_data --region sin --size 10
- Deploy an empty node
> fly deploy
- Init the cluster:
> fly ssh console -C '/cockroach/init_cluster.sh' Connecting to cockroachdb-example.internal... complete Cluster successfully initialized
- Scale to 3 nodes
> fly scale count 3 Count changed to 3
- View CockroachDB status
fly ssh console -C '/cockroach/cockroach node status --insecure'
This example exports metrics for Fly.io to scrape. You can import CockroachDB's Grafana dashboards to see how your cluster is doing.