UNDER-REPLICATED RANGES not working with new node

Hi,

I was working with only one node create database and insert update records for some time, now i have created a new node and join with my old created node its created successfully and show my database created with node1 but it still show all rages as UNDER-REPLICATED RANGES. My understanding is that it should be 0 after configuring new node. Please let me know what i need to do further for UNDER-REPLICATED RANGES and how to troubleshoot this problem.

Thanks

Hey @muhammad.habib

The UNDER-REPLICATED RANGES that is shown in the AdminUI is based on the replication factor set for your zone configuration, and compared to the number of nodes available. By default, the replication factor is set to 3, so in your case having 2 nodes would indeed indicate that you have under-replicated ranges.

Take a look at the zone configuration, and let me know what you find.

Cheers,
Ricardo

1 Like

Thanks @rickrock,

should i need to change these configurations using sql queries or is there any configuration file to alter configurations.

secondly if i have 2 nodes then replicated means both nodes should have same data means all records available on both nodes. am i right ?

and when i tried to update replica setting with following query

ALTER RANGE default CONFIGURE ZONE USING num_replicas = 2

it throw error
“ALTER RANGE default CONFIGURE ZONE USING num_replicas = 2”

Hey @muhammad.habib

CockroachDB requires at least 3 replicas, as 3 is the smallest number that can still achieve quorum. In the case 1 node goes down, you still have a majority of nodes (2) to be able to access data in the DB. We describe that in more detail here in our docs.

Are you going to be placing locality constraints on your nodes? See the documentation for further details on how to approach this.

1 Like