Rolling join new node of cluster?

Hi, I am new to CockroachDB.
I’m looking whether if any practice that builds a cluster which initial with one node and join second and third node after then.

It looks like while I start a new node, I need to provide the other node address as well as below.

cockroach start --insecure --store=node2 --listen-addr=localhost:26258 --http-addr=localhost:8081 --join=localhost:26257,localhost:26258,localhost:26259 --background

I wonder can it be done by joining one by one if we need more scalability later.
Thanks for your input.

Hi @itplayer,

The --join flag is required when you want a new node to join an existing cluster.

When you want to add new nodes to your cluster, just point the flag to a few of the nodes already in your cluster.

Thanks @mattvardi
So the first node doesn’t need to specify the --join flag and other node’s address?

Hey @itplayer,

For starting a single node cluster, I think the guidance here really sums up what is required. (There are no join flags).

When you are ready to scale out to multiple nodes, you can provide the other nodes.

Thank you.
However, let’s say if I have the first node, then I setup the second node then start with the second node with join flag with node one’s address, this is simple and clear.
Now, if I have the third node, it is definitely that I need to bring the third one with join flag as well as current three node’s address. At this moment, do I need to restart the previous two nodes to let them know current there are three nodes should be formed as c cluster? Or after third node join, all the node will be notified and store cluster info event after any of them restrat?

Thanks

After the third node joins, it’s gossip information will enter the cluster and all nodes will be aware of it :slight_smile: