ejabberd - Comments for "Unable to Cluster Nodes Across WAN - ERL syntax error" https://www.ejabberd.im/node/3029 en Clustering Problem Just Resolved https://www.ejabberd.im/node/3029#comment-53285 <p>As I was performing more tests and refering to older posts in the forum I came across the following posts, which exibited my second issue. Here is the first post <a href='http://www.ejabberd.im/node/2915'>http://www.ejabberd.im/node/2915</a>. This lead me to the second post <a href='http://www.ejabberd.im/node/2901'>http://www.ejabberd.im/node/2901</a>. Both were explaining the same issue as I was having, which was getting the ejabberd second node to point to the newly created cluster database.</p> <p>I simply removed the old database contents and copied the new database files into the old database folder. I then started the second node up and the second server node showed as being active from within the first node. I could not find a variable to set to the new database. I tried editing the registry ARG value, but this seemed to have no affect.</p> <p>I will need to send some messages across the network to see it is correctly set up, but I am much further than I was at the beginning. If this is not the correct fix to problem please let me know. </p> <p>Regards,<br /> SV</p> Wed, 11 Jun 2008 20:48:29 +0000 svhdesigns comment 53285 at https://www.ejabberd.im Partial Success Clustering Server Nodes https://www.ejabberd.im/node/3029#comment-53284 <p>Thanks for response TF!</p> <p>I did the steps that you suggested, but still no success. After many tests and retests I started to see some light at the end of the tunnel.</p> <p>I realized that all this time I had been opening the erl.exe command window directly and running these command line strings from within the erlang shell. This time I opened the command window and entered the /bin directory and ran the command from the directory prompt, which in turn opened the shell. Now I got a totally different response and was able to copy the database over. I then ran mnesia:info() and viola!, I see both nodes listed as running. I go back to the first server node and withing the admin web interface I click on nodes and both server nodes are listed as running. Now here is where I start to lose the momentum. I follow the remainder of the instructions typing q(). into the second node erlang shell window and the erlang shell exits. Now I click on the desktop start icon as I did on the first to start up the ejabberd second node and the admin web page opens. I go back to the first server to see how things are running and the second node is now listed and being stopped. What did I miss? I go back to the second node, checking the registry to make sure that the ARGS does not have a mnesia dir value and it does not. I even try to enter the ARG value in pointing to the newly created database folder. </p> <p>As I read the instruction, item number 6 states to "Now run the ejabberd on second with almost the same config as on the first". What does this mean? I assumed that it would have set the second node up to do this already. Steps 1 through 5 went fine, but I am stuck at 6.</p> <p>Can anyone guide me towards what I missed?</p> <p>Thank you,<br /> SV</p> Wed, 11 Jun 2008 20:00:50 +0000 svhdesigns comment 53284 at https://www.ejabberd.im Try checking database names https://www.ejabberd.im/node/3029#comment-52391 <p>I'm still very new with ejabberd (running 2.0.0 on OpenSuSE), and I still have a few questions of my own, but this sounds similar to an issue I had when first experimenting with clusters.I discovered that one of my servers had named the ejabberd (mnesia) database "ejabberd@localhost", while the one on the other server was named "ejabberd@hostname.com". The server with the "@localhost" database would give me errors similar to what you're getting. I was also unable to replicate any tables, although I got a successful "ping" and "pong" from either server. I solved the problem by simply deleting (the server was not in production, so I was able to blow away the dbase without worries - you may want to keep a copy just in case) the database ending in "@localhost", and then creating another database by running:</p> <p>~/erl -name ejabberd -mnesia dir '"/opt/ejabberd-2.0.0/database/ejabberd\@yourhostname.com"'</p> <p>(Note "-name" instead of "-sname" and the "\" escape character before "@".)</p> <p>Once I created the new dbase, I followed the instructions in the setup doc to replicate the tables over from the other server.</p> <p>My theory is that the database name discrepancy is caused by your choice during the ejabberd install. If you select "No" for "Will this node be part of a cluster?", the database is named "ejabberd@localhost". If you select "Yes", it is named the other. In my case, I had an existing, non-clustered server, and then attempted to add a server and create a cluster, so the existing server had the "@localhost" database.</p> <p>Hope this helps.</p> <p>TF</p> Tue, 13 May 2008 18:50:27 +0000 TFerguson comment 52391 at https://www.ejabberd.im Further Cluster Debugging https://www.ejabberd.im/node/3029#comment-52379 <p>I am still trying to track down the error. In a troubleshooting test, I wanted to check connectivity between servers. I logged into both servers and ran the erl ping command on both, which in turn responded with 'pong'. This tells me that both ejabberd nodes can see each other without issue. I still receive the "** 1: syntax error before: ejabberd **" message every time I attempt to cluster. It almost acts as if it does not know its own commands or the published syntax is for an older revision.</p> <p>Another test I ran was to enter "-sname" by itself to see what transpired, here is the result...</p> <div class="codeblock"><code>=ERROR REPORT==== 12-May-2008::09:37:34 ===<br />Error in process &lt;0.353.0&gt; on node &#039;ejabberd@second&#039; with exit value: {badarith<br />,[{erlang,&#039;-&#039;,[sname]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}<br />]} <p>** exited: {badarith,[{erlang,&#039;-&#039;,[sname]},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {erl_eval,do_apply,5},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {shell,exprs,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {shell,eval_loop,3}]} **</p></code></div> <p>I also get a similair message with "-mnesia" and "-s". Not sure if this helps track down a root cause, but thought it might help.</p> <p>Not sure where to go from here.</p> Mon, 12 May 2008 14:43:19 +0000 svhdesigns comment 52379 at https://www.ejabberd.im