DEV Community

Discussion on: Simulating a Multi-Region CockroachDB Cluster on localhost with Docker

Collapse
 
fabiog1901 profile image
Fabio Ghirardello

Sure, this is a very simple way to bring up a single-node CockroachDB cluster

docker run --rm -d --name=roach -p 8080:8080 -p 26257:26257 cockroachdb/cockroach:latest start-single-node --insecure
Enter fullscreen mode Exit fullscreen mode

Then open the SQL prompt with

# we assume you have downloaded the binary
cockroach sql --insecure
Enter fullscreen mode Exit fullscreen mode

Open the DB Console at localhost:8080

Collapse
 
liqlos profile image
Aleksey Bukhalov • Edited

Yes, start-single-node works fine, but we will have multi regional setup in production and I wanted to run with "cockroach demo" command in container, is it possible? It works locally without container, but I cannot get it running in docker. If I run it with --logtostderr flag it looks like some connectivity issues between nodes inside container

Thread Thread
 
liqlos profile image
Aleksey Bukhalov

docker run cockroachdb/cockroach demo --nodes=3 --no-example-database --logtostderr

Thread Thread
 
fabiog1901 profile image
Fabio Ghirardello

Interesting, I don't know on top of my head, and I invite you to join our Community Slack channel, cockroachlabs.com/join-community/