Hi,
I have configured 2 instanced Ejabberd cluster, but I am not sure everything is ok with my configuration.
Actually I have followed the official documentation and successfully configured the cluster which contains 2 instances of Debian servers (deb1 and deb2).
From Ejabberd and Erlang perspective, all looks great, because I can check that:
1. "running_db_nodes" field in Mnesia contains both deb1 and deb2. (on both erlang nodes)
2. Both nodes can see each other (the erl command "nodes()." returns deb2 on deb1, and deb1 on deb2). Also they can ping each other via net_adm() command.
3. I have clustered all tables of Mnesia, and I can see any update done on one server also on another (e. g. adding vCard info of a user).
However, the issue is when I try to login a user which has registered on deb1, by connecting to the deb2 server (for checking if my cluster will work when deb1 goes down) I am getting error on PSI client - "Server Error: Unknown Host".
I have found out, that the only way to get this working (i. e. logging in any user on any node regardless of on what node did user registered), is to list my two nodes in "hosts" property of "ejabberd.cfg". Like this:
{hosts, ["deb1", "deb2"]}.
Since I have never met about mentioning such thing in configuration when clustering ejabberd, I wonder if it is normal way to do, and if there is not other way to gain what I am aiming.
Can anyone help me please ?
Listing all nodes in hosts is not a big deal for me to do. I just want to make sure that this is proper and acceptable configuration specially for gaining the simple Clustering capability.
Thanks in advance,
Hambik
P. S. Note that in etc/hosts files I have also listed both deb1 and deb2 IPs on both nodes
You are mixing two
You are mixing two independent concepts. Each concept comes from a diferent kind of connectivity: ejabberd is a «XMPP server» with «Erlang clustering support»:
A) XMPP domain name. Example: company.com. This is configured in ejabberd.cfg. This defines the Jabber ID of the accounts, for instancehambikand@company.com . DNS setup is required, to ensure XMPP clients and other XMPP servers can connect to this XMPP server.
B) erlang node name. Examples: server7.company.com, or machine34139.bunker7.hosting.com. This is configured in ejabberdctl.cfg, and used when setting up erlang clustering. This defines the node in a cluster. DNS setup is required, to ensure other erlang nodes in your cluster can connect to this node.
Thank you for your answer. So
Thank you for your answer.
So did I get correct you that "company.com" domain name should be the host of load-balancer behind which the real nodes of cluster must stand ?
I think yes.
I think yes.