Skip to main content
Once you’ve , you can simulate multi-region cluster on your local machine using to learn about CockroachDB’s .
is not suitable for production deployments. Additionally, simulating multiple geographically distributed nodes on a single host is not representative of the in a production deployment. To learn more about production multi-region deployments, refer to and , and review the .

Before you begin

and .

Step 1. Start the cluster

Use the following 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 and also simulates the network latency that would occur between nodes in these localities. For more information about each flag, see the documentation, especially for .
When the cluster starts, you’ll see a message like the one shown below, followed by a SQL prompt. Note the URLs for:
  • Viewing the : http://127.0.0.1:8080.
  • Connecting to the database from a or a : 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:
You can run some basic :

Step 3. View cluster health and performance in the DB Console

The gives you insight into the overall health of your cluster, as well as the performance of any . To verify that the 9 nodes you specified are up and running as expected, go to the at http://localhost:8080/#/overview/list.
Capacity metrics can be incorrect when running multiple nodes on a single machine. For more details, refer to .
To see which nodes are located in which regions, and to see the simulated latencies between them, go to the page at http://localhost:8080/#/reports/network/region To access a variety of time series charts, including graphs of and , go to the page at http://localhost:8080/#/metrics You may also find the following pages useful:

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 the documentation.

What’s next?

  • for your preferred language
  • Learn more about and the
  • Further explore CockroachDB capabilities like: