Things to do for a single node cluster

Is there any guidelines for the things to be done if we plan to have a single node cluster (like turning off some cluster feature may be distributed query, etc) ?

Hi @tuk,

We generally recommend that clusters have at least three nodes, to ensure that CockroachDB’s automated replication can keep your data safe and available. But as long as the node has reliable backing storage (for instance, using RAID technology), and you take regular backups, this could be a reasonable approach. In particular, we think this is a useful way to go if you expect to scale the cluster at some point in the future.

The main thing you’ll want to do on a single-node cluster is disable replication. That way the database doesn’t waste time looking for places to put the other replicas (there aren’t any), and you won’t get spurious warnings in the admin UI about under-replicated ranges. Disabling replication just requires updating the zone configuration – use cockroach zone set .default --disable-replication from the command line, or if you already have a zone config file (unlikely in a single-node cluster) just add num_replicas: 1 to the replication zone.

Andrew

Thanks @couchand.

Will we gain anything by disabling distributed execution parameter SET CLUSTER SETTING sql.defaults.distsql = 0; in a single node cluster?

There’s not really anything to be gained by turning off the distsql engine, the performance difference is negligible (and there are potentially risks in doing so). At least the benchmarks we’ve done show that, please let us know if you’ve found something different.

Yes @couchand I already tried that. I was not seeing any improvement on turning off the distsql engine. So I was confirming.