Start the Cluster
1. Start your first node with the cockroach start command
cockroach start --certs-dir=certs --store=node1 --listen-addr=localhost:2000 --http-addr=localhost:8080 --join=localhost:2000,localhost:2001,localhost:2002
The certificate directory is referenced by the –certs-dir directory. As this is a local cluster, the node will listen on localhost only hence we provide –listen-addr=localhost:2000 and –http-addr=localhost:8080. Internal and client traffic is routed through port 2000, and HTTP requests from the DB Console are routed through port 8080. Data and logs are stored in a location in –store
The addresses and ports of the nodes that will initially make up your cluster are specified by the –join flag. We’ll use these addresses to start new nodes.
2. Launch the remaining nodes, carefully adjusting ports and join addresses:
Node 2:
cockroach start --certs-dir=certs --store=node2 --listen-addr=localhost:2001 --http-addr=localhost:8081 --join=localhost:2000,localhost:2001,localhost:2002
Node 3:
cockroach start --certs-dir=certs --store=node3 --listen-addr=localhost:2002 --http-addr=localhost:8082 --join=localhost:2000,localhost:2001,localhost:2002
How to Install CockroachDB Cluster on Debian 12
Debian 12 is a versatile and robust operating system ideal for hosting various applications, including distributed databases like CockroachDB. In this guide, we’ll walk through the process of installing and setting up a CockroachDB cluster on Debian 12. CockroachDB is a scalable, distributed SQL database designed for cloud-native applications, and installing it on Debian 12 provides a reliable foundation for building resilient and high-performance database clusters.
Contact Us