Dynamically adding nodes
I am fresh here, hope you don't mind several questions:)
Is it possible to dynamically add/remove nodes to the Tigase cluster without restarting other nodes?
As I understand there is a single point of failure - the session manager node, or am I wrong?
I am trying to approach Tigase in the "start simple, then evolve" approach. But I am not sure where to start and how to set up things.
Let's take an example:
there are 100 people community and they chat using Pidgin by connecting to a dedicated domain. Then these people start inviting other people and network very soon has to deal with 10000 people. Things happen and server goes down, then 10000 people cannot talk... So I need to ensure there is no single point of failure, and user don't even notice when some backend node goes down as their requests are automatically managed by a different node.
So I am trying to come up with a setup that satisfies the above described requirements. Can anyone suggest how should I attack the problem? What network topology to use. What to cluster (db, Tigase), how to stay stable and scalable?
I don't have too much experience with scalability, but there are usually things like web nodes, loadbalancers, serializable sessions, etc. Where and how do these things fit in Tigase and XMPP in general?
It would be great if under this topic we come up with an example of a 'beautiful' configuration which could be a best-practice setup. What do you think?
Trackback URL for this post:
- Add new comment
- 217 reads






What we normally do is we add custom database connector for Tigase server which allows the IM server to connect to your webapp database for users authentication. This is just a single Java interface which needs to be implemented and it is quite simple thing to do.
Then you have a single user database for both services which is very convenient because users have the same login name and password for both. And what is even more important you can easily manage your account from the www interface of your webapp.
Another story is to allow for autologin for your Web client. I mean, the user logins to the website and you would like him to automatically login also to the web IM client. There are many ways to do it and actually this is a bit out of scope with regards to the Tigase server.
You could for example pass login data from your webapp to the web IM client when it is started after the user is logged in. This is probably the simplest solution but not very secure as user login data may be exposed to third party person.
Another, maybe better way would be to pass an authentication TOKEN to the web IM client which would allow it to sign in to the IM server and then the TOKEN should be destroyed.
Thanks for your reply, looks that it shouldn't be a problem with the nodes eventually:)
Another thing that I wanted to ask is how to integrate a session in Tigase with a session in my webapp. The usage will be something similar to the minichat on tigase.org.
More specifically:
there is a Web application, where users login/logout. That application has a chat client. And whenever a user logs into the website, he/she is also logged in to the chat client.
So I wonder if it will be difficult to integrate these two things into one, because there is a Web server for webapp and Tigase for chat.
What do you think?
Evaldas
Hi,
As you correctly said there is a single point of failure in the Tigase server right now - the SessionManager component. I am now working on an improved cluster mode (called full cluster mode) implementation and the first version of the code should be ready by the end of this week. Then there is no single point of failure in the Tigase server.
I guess in a month the code should become stable and ready for production deployments.
Now back to your questions.
It all depends how do you want to approach the project. You could start with a small installation - all on a single machine and then when you think your service grew up to bigger scale and you need more machines for reliability and performance reasons you can add more nodes.
The best option of load-balancing for XMPP server is DNS based load balancer. This is because of the specific way the XMPP servers work comparing to web server for example. The user establishes a permanent connection to the server based on the DNS resolution. Therefore round-robin DNS balancer gives you very even distribution of user connections over the cluster nodes.
The Tigase server allows for adding more cluster nodes (in fact for changing any configuration parameters) without restarting the server. And I am putting lots of effort in the new cluster implementation to make adding more nodes easy and without disruptions.
Regarding the databases and clustering I have only experience with MySQL database in cluster mode. So my suggestion is to install Tigase on a single machine first with MySQL database. To make adding more nodes as easy as possible I would also suggest to install MySQL in cluster mode even if it only works on a single machine. Then adding next node would allow you to keep downtime to minimum.
Normally you don't need to restart the Tigase server except when you want to upgrade the server to more recent version and that would be the case when the new cluster mode is released.