Production
Time Sync
- CockroachDB requires moderate levels of clock synchronization to preserve data consistency
Sizing
- The size of your cluster corresponds to its total number of vCPUs.
- A smaller number of larger nodes emphasizes cluster stability
- A larger number of smaller nodes emphasizes resiliency across failure scenarios.
Deploying in a single node
Creating certificate for the node
Creating the certificate and key for the first node:
cockroach cert create-node \
172.16.221.243 \
172.16.221.243 \
keycloak-poc \
localhost \
127.0.0.1 \
172.16.221.226 \
haproxy-poc \
--certs-dir=/data/certs \
--ca-key=/data/certs/ca.key
Creating the certificate and key for the Second node:
cockroach cert create-node \
172.16.221.230 \
172.16.221.230 \
keycloak-poc \
localhost \
127.0.0.1 \
172.16.221.226 \
haproxy-poc \
--certs-dir=/data/certs \
--ca-key=/data/certs/ca.key
Starting the nodes
- SSH into node.
- Start cockroach
cockroach start \
--certs-dir=/data/certs \
--advertise-addr=172.16.221.243 \
--join=172.16.221.230 \
--cache=.25 \
--max-sql-memory=.25 \
--background
cockroach start \
--certs-dir=/data/certs \
--advertise-addr=172.16.221.230 \
--join=172.16.221.243 \
--cache=.25 \
--max-sql-memory=.25 \
--background
Load Balancer (Haproxy) Config
Refer => Load Balancing CockroachDB using Haproxy
Reference
- Production Checklist | CockroachDB Docs
- Deploy CockroachDB On-Premises | CockroachDB Docs
- Generation of CA Certificates
- Linux Installation
- Deploy CockroachDB On-Premises | CockroachDB Docs
- Haproxy configuration
- How To Deploy CockroachDB on a Three-Node Cluster on Ubuntu 16.04 | DigitalOcean