Shared chat rooms across nodes

We'd like to be able to set up a chat room under a single name, and have it shared across multiple hosts (all Windows machines). By this I mean we would like user1@machineA to be able to access room R as if it were on their own machine, while user2@machineB should also be able to access the room with the exact same name as if it were on machineB – and both user1 and user2 should see each other in the room. If the machines are disconnected from each other, each user should be able to still enter the room, but of course they won't see each other. Ideally, when the machines are reconnected and can see each other again, I'd like the room to "rejoin", so that both users again see each other in the room. (Both machines are already configured in a cluster... I think. There are some gaps in the manual on cluster setup. See below…)

Can I do this with virtual hosts? I.e., have a line in ejabberd.cfg on machineB like
{hosts, ["machineA","machineB"]}.
Will that allow me to have a room "R@conference.machineA" that does what I want?
Do I need a line like this for the mod_muc on machineB:
{modules,[{mod_muc, [{host, ["machineA","machineB"]}]}]}.

The important thing is I don't want to change anything on machineA… so, the lines in ITS config file would be:
{hosts, ["machineA"]}.
{modules,[{mod_muc, [{host, ["machineA"]}]}]}.

Maybe I am missing something about virtual hosts too… I assume two machines can have the same list of virtual hosts? Does there need to somewhere be a "real" host that corresponds to the virtual hosts? Am I missing something from the docs?

The documentation is also missing some pieces about setting up a full cluster of nodes – in particular, what exactly does it give you? MUC rooms shared across nodes? User logons with the same JID on different machines (ie, could we have users a@example.com, b@example.com and c@example.com, rather than a@A.example.com, b@B.example.com and c@C.example.com)? It seems that users on two separate (unclustered) nodes can talk to each other without additional setup (if the nodes have the same cookie), and in a local chat room I can invite users from other nodes… what advantage is there to clustering to help with the chat? And what about DB table replication during clustering setup… Is this really necessary to do? How do we know if we've duplicated all the tables we need to? (The guide is a bit unclear about all this..)

Thanks for your help...

The MUC service included in

The MUC service included in ejabberd is not clusterable.

What you want is two independent MUC chatrooms that replicate messages and users between them. You want that, even if the link between those chatroom is lost, both of them can still be used independently by their respective users.

I don't see ejabberd's clustering facilities helping here. Neither do virtual hosts.

If I'm correct, your options are:

  • improve mod_muc to allow cluster features
  • use another MUC service that implements what you want, if that exists (I'm not aware of)
  • use a Jabber bot that joins both chatrooms and replicates conversations from one to the other, informs of participant joins and leaves... That may seem dirty, but you can be sure it will work, and it doesn't seem that hard to implement. There are probably Jabber bots out there that implement most of the required features (Chatbot, Neutron, Sulci...) in a variety of languages you can find experts out there, Perl, Python, Ocaml...
  • modify your original requirements and adapt them to the possibilities of existing software

Thanks for the help

That helps to clarify things... we'll have to evaluate our requirements and see where and how we can make things fit.

Syndicate content