How do replicas work?

#1

I thought you only needed the same number of nodes as replicas. So if I want one replica I just need two nodes. I currently have a two node cluster and one of our nodes went down, but when I click on failover it says there aren’t replicas of all data on that node. How come it did not create a replica of my data on the other node?

#2

On the face of it, if you’ve got one replica configured, you should be able to fail over one node without data loss (and 2 nodes with 2 replicas etc.).

As a couple of first thoughts:

  • How many buckets do you have in the cluster? Do they all have a replica configured?
  • Which version are you running? The warning messages have changed a bit over time and on some versions they defaulted to saying that data loss would occur, even if that wasn’t exactly the full picture - MB-11268 has some discussion around this.
#3

Thanks for the info. I have four buckets in the cluster and they all have one replica enabled. I’m running Couchbase Server Enterprise 3.0.1 so it looks like that bug may affect me.

#4

I believe the reason for that error message is that not all data may have been replicated before you trigger the failover. By default, replication is handled in background from the active location to the replica location. With the SDKs there is an option, durability requirements, to be able to handle certain failure cases at the application level.

#5

Thanks, that’s good to know.