JABASE ABOUT | FAQ | DOWNLOADS | CONTACT | FOR DEVELODPERS

ABOUT JABASE

Jabase: highly scalable instant messaging solution.
Jabase is an integration solution, provided by Division By Zero, that enables building highly scalable instant messaging server clusters using distributed HBase database and ejabberd XMPP server.

FAQ

What is Jabase?
Jabase is a middleware set of components providing communication layer between ejabberd XMPP server and HBase distributed database. While ejabberd ensures communication between users and server instances, HBase provides highly scalable, distributed database to store large amount of data and serve them efficiently.
architecture
Jabase enables building large, scalable and fault tolerant XMPP server clusters, providing reliable and fast instant messaging service to hundreds of thousands of users. The power of the cluster can be easily increased just by adding new machines to the network.
chart1chart2 Thanks to the Erlang layer, the cluster is aware of the topology and presence of its nodes, providing maximum efficiency and fault tolerance.

What is XMPP?
XMPP (Extensible Messaging and Presence Protocol) is an open standard, XML-based protocol aimed at instant messaging. Popular XMPP services include massive communication platforms such as Jabber or Google Talk, as well as various microblogging portals and news feeds. XMPP is a very flexible protocol, providing gateways (also known as transports) not only to networks using other protocols, like MSN, but also to other messaging services, such as SMS or email.

What is ejabberd?
Ejabberd is a very efficient XMPP server written in Erlang, a concurrent programming language developed initially at Ericsson to build build large-scale, fault-tolerant and distributed applications for telecommunications industry. Applications written in Erlang provide soft-realtime processing of large amount of data, and have been sucessfully used in various environments from telephone switches to web servers.

What is HBase?
HBase is a high performance, distributed database written in Java. HBase has been created as an open source alternative to Google Bigtable, and provides similar features: high availability, fault tolerance, and scalability. It is designed to quickly process large amount of data and scale up easily. HBase works on top of Hadoop, a distributed storage solution inspired by Google File System.

DOWNLOADS

- ejabberd-2.0.3.tar.gz
- erlbase-1.0.tar.gz
- jabase-1.0.tar.gz

CONTACT

If you have trouble building a cluster of XMPP machines on Jabase yourself, contact us for detailed instructions and support.

FOR DEVELOPERS

Installation Instructions


The installation instructions apply to Linux only. To install the software on a different operating system you need to adjust the procedures to suit your operating system requirements accordingly. This manual covers installation instructions of the XMPP server only. It does not cover installing and configuring Hadoop filesystem nor HBase database and it assumes that you already have a HBase database up and running.

Prerequisites:

To install Jabase software you need the following software installed: - Erlang R11-B (or newer)
- Java Development Kit 1.6 (or later)
- Ant 1.7 (or newer)
- Hadoop 0.19.x and HBase 0.19.x
You will also need a standard Linux GCC compiler and MAKE tool to build ejabberd XMPP server from source.

Instalation:

Download and unpack all packages. Patch ejabberd source with erlbase patches, compile it and install as described in ejabberd documentation. Next, build jabase with ant and copy resulting jabase.jar from build/dist to a directory of your choice.

Configuration:

Go to directory "/var/lib/ejabberd" and create file ".erlang.cookie". Put into this file a short random string, which will serve as a secret password shared among all XMPP server instances in a cluster. Next, open ejabberd configuration file "/etc/ejabberd/ejabberd.cfg" and replace "localhost" in {hosts, ["localhost"]} with a preferred XMPP domain name. Now go to HBase "bin" directory and start HBase shell:

./hbase shell

When you see the prompt, type in the following command to create a database table that will store all Jabase data:

create 'jabase', 'login', 'password', 'last', 'status', 'vcard', 'friends', 'spool'

When table creating is complete, you can leave HBase shell with "quit" command.

Running:

First, start Jabase connector with the following command:

java -jar jabase.jar -c COOKIE -m MASTER:60000 &

Replace COOKIE with the secret string written in ".erlang.cookie" file, and MASTER with HBase master host name. Next, start ejabberd server with command:

ejabberdctl start

Your XMPP server is now ready to send and receive requests. For detailed documentation regarding server configuration refer to ejabberd documentation. Although ejabberd can serve multiple domains simultaneously, currently you can serve only one domain when using ejabberd with Jabase.

Debugging:

To start Jabase in debugging mode, use the following command:

java -jar jabase.jar -c COOKIE -m MASTER:60000 -d

To log debugging data to a text file, use:

java -jar jabase.jar -c COOKIE -m MASTER:60000 -d -f FILE

Replace COOKIE with the secret string written in ".erlang.cookie" file, and MASTER with HBase master host name. Now open a new command shell and start ejabberd server with command:

ejabberdctl live

Clustering:

To build a farm of XMPP servers, you need to repeat the above procedure for all machines in the cluster. You also need to create ".hosts.erlang" in "/var/lib/ejabberd" on each node, containing a list of all other nodes in the cluster (refer to Erlang documentation for details) and make sure that ".erlang.cookie" is identical on all hosts. When configured properly, servers in the cluster can see each other automatically when started, without any additional procedures.

Jabase does not include any additional utilities to support load balancing. To assign users to different machines working in one cluster you should use external tools, for example hardware or software DNS load balancers.

Troubleshooting:

If you have problems using ejabberd through Jabase on a single machine, perform the following steps:

First, start Jabase connector in debugging mode, using the following command:

java -jar jabase.jar -c COOKIE -m MASTER:60000 -d

Next, open a new command shell and start ejabberd server with command:

ejabberdctl live

When ejabberd says "Press any key to continue", press Enter and observe Jabase command shell. You should see Jabase output similar to the following:

09/03/11 11:17:48 DEBUG jabase.Server: Received message {#Pid<ejabberd@host1.246.0>,get_all_sessions,[]}
09/03/11 11:17:48 DEBUG jabase.GetAllSessionsThread: Getting all sessions
09/03/11 11:17:48 DEBUG jabase.GetAllSessionsThread: Found 0 session(s)
09/03/11 11:17:48 DEBUG jabase.GetAllSessionsThread: Sessions found: []
09/03/11 11:17:48 DEBUG jabase.GetAllSessionsThread: Sending reply {result,[]} to #Pid <ejabberd@host1.246.0>


If you don't see anything it means that ejabberd can't connect to Jabase. Switch to ejabberd shell, press Enter again and type in the following command:

erlang:get_cookie().

This will display Erlang cookie used by ejabberd. Make sure it is exactly the same string as stored in ".erlang.cookie" file and used in Jabase command line argument. Also, make sure that ".erlang.cookie" file is stored in the right location.