How many host can support database?

Hi I am using LXD clustering. I have four host and I added all in one cluster but after three fourth one is showing database in NO though I can create container in fourth one also. but problem is when my two host is down from database status NO is now not doing anything so cluster is not working. it is a problem ? even after removing node3 from cluster I can start and stop conatainer also which is in node1 and node2!! in below ficture i just shutdown the host to check it.

but when I remove node4 from cluster node3 is showing database is YES!! and also working fine. 4

my node4 is not in cluster but it is available. what is the easiest way to add that node4 in cluster? I can add node4 in cluster if I remove everything from node4 and again add that node through lxd init!!

Is it bug?

All what you reported is expected, and there is no bug.

At the moment the cluster tries to always keep 3 database nodes. If you have 4 nodes, you will have 3 database nodes. If you remove one database node out of those 4, the cluster will notice that there are only 2 database nodes left and promote the non-database node to be a database node.

However, if you just shutdown a database node (as opposed to remove it entirely), then nothing happens, because the cluster expects to it’s only down temporarily and it will eventually come back. In the future we will support automatically promoting nodes even in those cases, if a database nodes is down for too long.

Hope that’s clear.

Okay for database but problem is when I removed node3 from cluster why still container can control from node3 ? two containers in cluster one in node1 and another is node2. first removed node3 from cluster but I can start and stop container from node3 still !! is it also expected ?

btw thank you for your reply.

Oh, okay, I didn’t understand this part. No, this sounds like a bug that should be fixed. Did you use the --force to remove the node? I’ll try to reproduce the issue.

Without force last time it’s was possible to control container but this time I removed with force. now it is working fine. not possible to check any container from node which is not in cluster.

Thank you.

Hello, I tried this:

  1. Setup a cluster of 3 nodes: node1, node2 and node3
  2. Create a container c1 on node2
  3. Remove node3 from the cluster (without --force)
  4. Run lxc list on node3

The outcome is that container c1 does not show up in node3. If you experience something else, please post the exact steps to reproduce the problem.

today I tried without force to remove a node. It is working fine. but I don’t know what was the problem last time. Thank you so much.