1

I have two servers in two different geographic locations (alfa1 and alfa2).

r.tableCreate('dados', {shards:1, replicas:{alfa1:1, alfa2:1}, primaryReplicaTag:'alfa1'})

I need to be able to write for both servers, but when I try to shutdown alfa1, and write to alfa2, rethinkdb only allow reads: Table test.dados is available for outdated reads, but not up-to-date reads or writes.

I need a way to write for all replicas, not only for Primary.

Is this possible ? Does rethinkdb allow multidatacenter replication ?

I think that multidatacenter replication need to permit write for both datacenters.

I tried to remove "primaryReplicaTag" but system don't accept !

Any help is welcome !!!

Carlos
  • 51
  • 1
  • 1

1 Answers1

0

RethinkDB does support multi-datacenter replication/sharding.

I think the problem here is that you've setup a cluster of two, which means that when one fails you only have 50% of the nodes in the cluster which means you have less than 51%.

From the failover docs - https://rethinkdb.com/docs/failover/

To perform automatic failover for a table, the following requirements must be met:

  • The cluster must have three or more servers
  • The table must be configured to have three or more replicas
  • A majority (greater thanhalf) of replicas for the table must be available

Try adding just one additional server and your problems should be resolved.

dalanmiller
  • 3,467
  • 5
  • 31
  • 38
  • "Majority" does not mean "51%." It means "more than 50%." The reason 1/2 isn't a majority is not because `0.5<0.51` but because `0.5<=0.5`. Consider, for example, a group of 101 servers out of 200: that _is_ a majority, but it's less than 51%. – phoog Feb 06 '21 at 20:13