Can cluster be available when the number of cluster nodes is reduced from 2 to 1?

Dear all,

I was surveying the cluster HA about lxd.
In the below link, the Recover from quorum loss paragraph.
It mentioned that when the number of cluster nodes reducing from 2 to 1, the cluster is unavailable.

During my operation, the cluster is really unavailable when it counts from 3 to 2 to 1.

Is there any configurations that can avoid this when my lxd cluster nodes reducing from 2 to 1?

So the minimum recommended number of cluster members is 3.
This allows for losing one member and cluster quorum being maintained. After that an odd number of members is recommended for the same reason.

Its also important to differentiate between total cluster members (including offline members) size vs total online cluster members.

You can have an operational cluster of just 2 members in total, but it won’t be highly available and losing the original cluster member will cause the other to stop working.

And if you have a total cluster size of 3 members, then one member can go offline and the other two will continue to function, but if two of them go offline then the cluster will stop functioning until quorum can be restored.

@stgraber @mbordere is this correct?

Yep. You need 3 members to have the DB be replicated, until then, only the initial cluster member will have the DB so it going down will break the LXD API.
When you have 3 members, you can have one of them go offline and keep API access working normally.

When scaling past 3 servers, the next two will act as DB standby so can quickly be elected to full DB server when one goes down, then further servers after that are just DB clients. Note that the roles can be dynamically reshuffled by LXD as needed.

1 Like