Ejabberd Server Setup
Ejabberd Server Setup
wget http://erlang.org/download/otp_src_${VER}.tar.gz
cd otp_src_${VER}/
8. make
9. make install
erl --version
Ejabberd Setup
wget https://www.process-one.net/downloads/downloads-
action.php?file=/ejabberd/${VER}/ejabberd-${VER}.tgz
sudo apt-get install libexpat1 libexpat1-dev libyaml-0-2 libyaml-dev erlang openssl zlib1g
zlib1g-dev libssl-dev libpam0g
5. Change the directory
cd ejabberd-${VER}/
6. specify a different location for your installation by specifying a prefix on your configure
command :
./configure --prefix=/opt/ejabberd-server
7. make
8. make install
9. Those files are copied to the directory we specified with our configure command in the
prefix option .cd to that directory and you see your ejabberd installation files :
10. Our ejabberdctl program is stored in the sbin directory.To test that our installation
works ,we can run it and check the status and run of our server :
11. If you go to the /etc/ejabberd directory of your installation you will see a ejabberd.yml
file.This is your configuration file.Open the file with your favorite text editor and add
another served host.This can be any ip address accessible from the outside or any ping-able
domain name. We are using a fake domain to our ip
13. To give our users admin privileges we modify the ejabberd.yml config file as follows:
14 . start the server
15. From your browser ,open the address( it is ofcouse your IP address that you use) :
http://IPAddress:5280/admin/
cd /opt
wget http://turnserver.open-sys.org/downloads/v4.5.0.6/turnserver-4.5.0.6.tar.gz
cd turnserver-4.5.0.6
apt-get update
7. Configure
./configure --prefix=/opt
8. make
9. make install
1. cp /usr/local/etc/turnserver.conf.default /usr/local/etc/turnserver.conf
2. lt-cred-mech
3. realm=ckotha.com
>>to create user ( please restart the instance before creating new user )
If the server is behind NAT then the following port range ( min-port to max-port must be
open)
min-port=49152
max-port=65535
Suppose you have already configured ejabberd on one node named ejabberd01. Let's create an
additional node (ejabberd02) and connect them together.
Alternatively you could pass the -setcookie <value> option to all erl commands below.
1. Make sure your new ejabberd node is properly configured. Usually, you want to have
the same ejabberd.yml config file on the new node that on the other cluster nodes.
2. Adding a node to the cluster is done by starting a new ejabberd node within the same
network, and running a command from a cluster node. On the ejabberd02 node for
example, as ejabberd is already started, run the following command as the ejabberd
daemon user, using the ejabberdctl script:
3. $ ejabberdctl --no-timeout join_cluster 'ejabberd@ejabberd01'
This enables ejabberd's internal replications to be launched across all nodes so new
nodes can start receiving messages from other nodes and be registered in the
routing tables.
To remove a node from the cluster, it just needs to be shut down. There is no specific delay
for the cluster to figure out that the node is gone, the node is immediately removed from
other router entries. All clients directly connected to the stopped node are disconnected,
and should reconnect to other nodes.
If the cluster is used behind a load balancer and the node has been removed from the load
balancer, no new clients should be connecting to that node but established connections
should be kept, thus allowing to remove a node smoothly, by stopping it after most clients
disconnected by themselves. If the node is started again, it's immediately attached back to
the cluster until it has been explicitly removed permanently from the cluster.
To permanently remove a running node from the cluster, the following command must be
run as the ejabberd daemon user, from one node of the cluster:
The removed node must be running while calling leave_cluster to make it permanently
removed. It's then immediately stopped.
Ejabberd Community Server uses mnesia internal database to manage cluster and internode
synchronisation. As a result, you may restart ejabberd nodes as long as there is at least one
running node. If you stop the last running node of a cluster, you MUST restart that node first
in order to get a running service back.