cockroach start command starts a CockroachDB node and joins it to a cluster. For single-node development clusters, use cockroach start-single-node instead.
Synopsis
Description
Start a CockroachDB node that exports data from one or more storage devices. The node will join an existing cluster or help form a new one.Required Flags
Comma-separated list of node addresses to join. Can specify hostnames or IP addresses with ports.Example:
--join=host1:26257,host2:26257,host3:26257It’s legal for the first node to join itself. Other nodes don’t need to be started yet when specifying them in
--join.Storage Flags
Storage device for node data. Can specify multiple stores by using this flag multiple times.Format:
[type=<type>,][path=]<path>[,<attribute>=<value>...]Attributes:type:memfor in-memory (testing only) or omit for on-diskpath: Directory path for data storagesize: Maximum size (e.g.,100GB,50%)attrs: Comma-separated attributes (e.g.,ssd,hdd)
Network Flags
Address/hostname and port to listen on for intra-cluster communication.Format:
[host]:portAddress to advertise to other nodes. Use when
--listen-addr is not routable by other nodes.Example: Public IP for cloud deployments with private networksAddress/hostname and port for SQL client connections.
Separating SQL and RPC listeners is recommended for production deployments.
Address for the DB Console and HTTP API.
Locality Flags
Ordered, comma-separated list of key-value pairs describing node topology.Used for replica placement and query optimization.
Colon-separated list of node attributes for constraint-based replica placement.Example:
--attrs=gpu:x16cMemory and Cache Flags
Total cache size shared across all stores. Accepts bytes, size suffixes (e.g.,
1GB), or percentage of physical memory (e.g., 25%).For production: allocate 25-50% of system memory to cache.
Maximum memory for SQL operations including query execution and prepared statements.Accepts bytes, size suffixes, or percentage.
Soft memory limit for the Go runtime (GOMEMLIMIT).
The Pebble cache (configured by
--cache) is not controlled by the Go runtime.Maximum disk storage for temporary SQL data (spills from memory).Location is within the first store directory.
Security Flags
Path to certificate directory. Required for secure clusters.Must contain:
ca.crt(CA certificate)node.crt(node certificate)node.key(node private key)
Start in insecure mode without encryption.
Background and Logging
Start the server in the background. Control returns to shell only when server is ready.
Configure logging output. See logging documentation for detailed syntax.Example:
--log='file-defaults: {dir: /var/log/cockroach}'Examples
Start First Node in Cluster
Start with Locality Information
Start with Multiple Stores
Start in Background
Start Single Node
For development and testing, use the simplified single-node command:start-single-node automatically initializes the cluster and sets replication factor to 1. The --join flag is not supported.Single Node Example
Post-Start Steps
Troubleshooting
Node Won’t Start
- Verify
--joinaddresses are correct and reachable - Check firewall rules allow connections on specified ports
- Ensure certificates are valid and properly configured
- Review logs in the data directory
Cannot Initialize Cluster
- Ensure at least one node is running
- Verify network connectivity between nodes
- Check that
--joinincludes addresses of running nodes