![]() ![]() If it stops outputting then you can press ENTER to get a prompt. This will start an erlang shell and it will give some output. On the slave node, start an ejabberd live shell: /etc/init.d/ejabberd live Also make sure the erlang cookies are synchronized. Make sure the master is working and running. We are now going to join the cluster node to the master node. You can find more info on the module here: Now check if it succeeded: ls | grep easy_cluster.beam Save it and compile it into a working erlang module: cd /usr/lib/ejabberd/ebin/ Mnesia:change_table_copy_type(schema, node(), disc_copies), ![]() Io:format("server could NOT be reached.~n") You can also execute the commands in the erlang functions itself on an erlang debug shell, but I find this easier and it gives less errors: vim /usr/lib/ejabberd/ebin/easy_cluster.erlĪdd the following contents: -module(easy_cluster).Ĭase net_adm:ping(MasterNode) of 'pong' -> This is a very small module which adds an erlang shell command to make the cluster addition easier. We are now going to add and compile an erlang module, the easy_cluster module. Now remove all the mnesia tables: rm /var/lib/ejabberd/*Ĭopy the cookie from the ejabberd master node, either by cat and vim or via scp: # On the master nodeĮcho "HFHHGYYEHF362GG1GF" > /var/lib/ejabberd/.okieĬhown ejabberd:ejabberd /var/lib/ejabberd/.okie If you use ejabberd internally then use the primary NIC address. vim /etc/ejabberd/ejabberd.cfgįirst we are going to add our chat domain name: Also, every config option ends with a dot (.). The ejabberd config is erlang config, so comments are not # but %%. ![]() Now use your favorite text editor to edit the config files. We are going to configure the ejabberd service. You will also install a few dependencies for the erlang runtime. This is simple, use your package manager to install ejabberd: apt-get install ejabberd If you want to set up a cluster, then also follow this part and continue with the next part. no clustering, then follow only this part and the DNS part of the tutorial. If you want to set up a single node installation of ejabberd, e.g. Single node / master node ejabberd installation For the clustering part the servers and are used. This tutorial uses the domain as the chat domain, and the server as the xmpp server domain. It also works on Windows Server 2012 with the ejabberd compiled from the erlang source but that is not covered in this tutorial. This setup is tested on Debian 7, Ubuntu 12.04 and 10.04 and OS X 10.8 Server, all running ejabberd installed via the package manager, either apt or ports. XMPP is an awesome and extendible protocol, on which you can find more here: Information I’ve got a ejabberd cluster running for a client consisting of 4 Debian 7 VM’s (2GB RAM each) spread over 3 sites and 1 datacenter, serving 12000 total users and most of the time 6000 concurrently. Or you might be a sysadmin in need of an internal chat solution. Did you know that big players like Facebook, WhatsApp and Google (used) to use XMPP as their primary chat protocol? And on Android you can use Xabber, Beem or OneTeam. You might want to use awesome multi-account chatting applications like Pidgin, Psi+, Empathy, Adium, iChat/Messages or Miranda IM. ![]() Turn of ejabberd logging and use Off The Record which gives you full privacy (and perfect forward secrecy). Or you might want to have more control over the logging of your data. And still use an open protocol which is widely supported, not being locked in to google specific software and hardware. If you have non-gmail chat contacts you can keep chatting to them. Google’s service recently changed and it is going to drop XMPP compatibility. You might use Google Talk or as it now is named Hangouts. There are a few reasons to set up your own XMPP server. Last but not least federation is also covered. It covers a basic single node ejabberd server and also the setup of an ejabberd cluster, including errors and DNS SRV record examples. This tutorial shows you how to set up your own federated chat network using ejabberd. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |