public static void setReplicas(Admin admin, TableName table, int replicaCount)
    throws IOException, InterruptedException {
    TableDescriptor desc = TableDescriptorBuilder.newBuilder(admin.getDescriptor(table))
      .setRegionReplication(replicaCount).build();
    admin.modifyTable(desc);
  }
Set the number of Region replicas.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java