cockroach demoto learn about CockroachDB’s multi-region abstractions.
cockroach demo is not suitable for production deployments. Additionally, simulating multiple geographically distributed nodes on a single host is not representative of the performance you should expect in a production deployment. To learn more about production multi-region deployments, refer to Orchestrate CockroachDB Across Multiple Kubernetes Clusters and review the Production Checklist.Before you begin
Download and Install CockroachDB.Step 1. Start the cluster
Use the followingcockroach demo command to start the cluster. This particular combination of flags results in a demo cluster of 9 nodes, with 3 nodes in each region. It sets the appropriate node localities and also simulates the network latency that would occur between nodes in these localities. For more information about each flag, see the cockroach demo documentation, especially for --global.
- Viewing the DB Console:
http://127.0.0.1:8080. - Connecting to the database from a SQL shell or a programming language:
postgres://root@127.0.0.1:26257?sslmode=disable.
Step 2. Enter SQL statements at the prompt
Now that your simulated multi-region cluster is running, you are presented with a SQL prompt:Step 3. View cluster health and performance in the DB Console
The DB Console gives you insight into the overall health of your cluster, as well as the performance of any client workloads. To verify that the 9 nodes you specified are up and running as expected, go to the Cluster Overview at http://localhost:8080/#/overview/list.Capacity metrics can be incorrect when running multiple nodes on a single machine. For more details, refer to Capacity metrics.
- The Databases page at http://localhost:8080/#/databases shows details about your databases and tables.
- The Statements page at http://localhost:8080/#/statements is used to assess the performance of specific queries.
- The Jobs page at http://localhost:8080/#/jobs is used to monitor the status of long-running operations like schema changes.
Step 4. Wipe the cluster
When you’re done with your demo cluster, you can wipe the cluster by typing the command shown below at the SQL prompt. Note that because this is a temporary, in-memory cluster, this will wipe any data you have added to the cluster. For more information, see thecockroach demo documentation.
What’s next?
- Install the client driver for your preferred language
- Learn more about CockroachDB SQL and the built-in SQL client
- Further explore CockroachDB capabilities like:

