Search code examples
yugabytedb

Changing replication factor of an already running cluster in YugabyteDB


[Question posted by a user on YugabyteDB Community Slack]

I've been googling a bit and it seems that, although it is not recommended to change the RF of an already running cluster, is it possible?


Solution

  • We support changing RF at the database layer at the very least. One way this can be accomplished is by using the modify_placement_info command in yb-admin [see yb-admin doc]. For example, if you have 3 nodes, one in cloud-c1, region-r1, and zone-z1, one in c2.r2.z2, and one in c3.r3.z3, you can use the below command to increase the RF to 3.

    bin/yb-admin --master_addresses {list of master IPs:Ports} modify_placement_info c1.r1.z1,c2.r2.z2,c3.r3.z3 3
    

    Another way to control RF is to use tablespaces https://docs.yugabyte.com/preview/explore/ysql-language-features/going-beyond-sql/tablespaces/