Let assume I have two ejabberd server
consider X
and Y
which has the same source and i did ejabberd clustering for those server by using this. Now consider A
and B
are user and those are connected in X server
. Both A and B are in ONLINE
state and those are connected via X server
. If suppose X server is get shutdown
or crashed
by some issue. In this sceneraio whether the A
and B
are get OFFLINE
state or A
and B
are in ONLINE
state which is handle by Y
server. I don't know whether my thought is right or not. If any one give me the suggestion about it.
问题:
回答1:
If you have nodes in different physical locations, you should set them up as separate clusters (even if it's a cluster of 1 node) and federate them. Clustering should only be done at datacenter level since there are mnesia transactional locks between all nodes in a cluster (e.g. creating a MUC room).
回答2:
"Load balancing" is not what you are describing in your question.
In load balancing, a incoming connections are distributed in a balanced fashion over multiple nodes. This is so that no one server has too high a load (hence the name "load balancing"). It also provides fail-over capability if your load balancer is smart enough to detect and remove dead nodes.
A smart load balancer can make it so that new connections always succeed as long as there is at least one working node in your cluster. However, in your question, you talk about clients "maintaining the connection". That's something quite different.
To do that, you'd either need the connection to be stateless or you'd need each client to connect to all nodes. That's not how XMPP works: it's a stateful connection to a single server. You must rely on your clients to reconnect if they get disconnected.