I need to know the online status of any user in a Federated (multi-cluster) ejabberd setup. I'm trying to call
ejabberd_sm:get_user_resources(User, Server)
to see if a user has any available resources to determine if a user is online or not but that only seems to work on the "local" domain of the user. I'm looking into
sm_db_type: mnesia|odbc|redis
but am finding very little documentation on this. Is this the right way to go? Is mnesia(default?) only local to the cluster? Can anyone point me to some documentation or have tips on best practices?
Thanks!
-Nelson
Just thinking out loud ..
Just thinking out loud .. I'm assuming odbc is not the way to go either as each cluster has it's own db. So is the solution to have a global redis server used by all clusters?
If you are talking about
If you are talking about federation, you are not talking about clustering. You have indeed to get the status by another mean. However, if your point multiple independant cluster to the same redis session management you may run into unexpected issue. We never tried that config. I am not sure what you are trying to achieve. I am under the impression that you are trying to use federation to simulate a single cluster, but I think all modules would not be aware of this intention and you would probably need to modify a lot of code in many part of ejabberd to achieve this.
Hi, thanks for responding!
Hi, thanks for responding! I'm definitely talking about federation. Let me rephrase and give a specific use case.
1) I have two XMPP servers with different domains: domain1.com and domain2.comuser1@domain1.com and user2@domain2.com user1@domain1.com and user2@domain2.com work perfectly (both chat and muc)user1@domain1.com
2) I have to users:
3) Messages between
4) From domain2 XMPP server, I need to know the online status of
calling ejabberd_sm:get_user_resources(User, Server) seems to only have access to the local domain's sessions. By default, sessions are stored in mnesia?
What is the recommended way to achieve this? Is this an uncommon use case?
-Nelson
Federation is by design pure
Federation is by design pure XMPP. You cannot make Erlang calls over federation. As you see, federation is no substitute for clustering.