can it be done that to start with only 1 node in production and then connect other nodes only when scalability and resiliency is needed? I am really sold into what cockroachdb is offering but minimum requirement of 3 node clusters with at least 1core,2gb ram per node seems a bit expensive to start with.
Yes, running just 1 node is a perfectly fine way of getting started. Taking regular backups will be important in case the disk fails, but cockroach works completely fine with just one node.
When you do want to scale up to 3 or more nodes, though, you should make the decision carefully. Once you’ve switched from a 1 node cluster to a multi-node cluster, there isn’t a safe way to bring it back down to only 1 node.
Also remember to use the most reliable storage you can, such as RAID if you control the hardware yourself, or your hosting provider’s network-attached storage (like EBS on AWS). In a multi-node cluster you may want to avoid these things in favor of single local disks (because it’s cheaper and CockroachDB provides redundancy in other ways), but in a single-node cluster they’re important for reliability.
Ahh, glad I asked. I nearly had decided on going with postgres again.
cool. noted on this.
How do you convert a single node cluster into a 3 node cluster?
You’d need to start new nodes. We have a doc on how to start a cluster and add nodes here.
Essentially, you need to start two new nodes, and make sure you add the
--join flag to the start command in order for the nodes to be part of the same cluster.
Thanks @ronarev for the quick response.
Just to be clear, this will work for a single node that is already populated with data? If that is the case I assume that once the other nodes join the data will automatically balance and replicate?
Then my next question, is there a way to return to a single node “cluster” after a 3 node cluster is established without a backup/restore? It would seam that any node in the 3 node cluster would have all of the data. I foresee rare situations where I would want to return to a single node cluster. I would accept that after this point the only way to go back to a 3 node cluster would be to add two completely new, data free, nodes.