Tigase Load Balancing strategy Chszs, not allowed to reprint without Bo master. Permission to reprint should be marked by the author and blog home: Http://blog.csdn.net/chszs
Tigase starting with version 5.2.0, load Balancing is introduced to redirect Terminal Access users to the most appropriate cluster node. This load balancing feature relies on the See-other-host XMPP stream error message (stream error messages). The basic principle behind this mechanism is that if the node that the user is currently trying to connect to is not the same node in the cluster, the user will be redirected. This principle requires the user's Jid implementation redirection.
First, the available implementation
The implementation of this tigase, like other implementations, is extensible, supports different, pluggable redirection strategies, and implements the SEEOTHERHOSTIFC interface.
There are currently three types of policies available:
1) Seeotherhost Strategy
This policy is the most basic implementation that returns a single host name or the current hostname in the init.properties configuration file.
2) seeotherhosthashed Strategy
This is the default policy used by Tigase, which hashes the user's Jid value and redirects the terminal connection to a node in the SEEOTHERHOSTIFC cluster environment based on the hash value. All valid nodes are determined by the default cluster composition and all nodes connected to the cluster and working, or all nodes can be configured into init.properties.
3) SEEOTHERHOSTDB Strategy
This policy is an extended implementation of the Seeotherhost policy, which determines which node the end user should be redirected to, based on the user_id and node_id pairings of the Tigase database.
Second, configuration options
The following is the most basic configuration of the actual load balancing redirection:
–cm-see-other-host=
Its possible values include the following:
tigase.server.xmppclient.SeeOtherHosttigase.server.xmppclient.SeeOtherHostHashedtigase.server.xmppclient.SeeOtherHostDBnone - disables redirection
Description: The first three behaviors are three redirection strategies, the last of which is not to use redirection strategies.
All the remaining options are configured on the basis of Connection Manager Per-connection-manager, so these options need to be prefixed with the corresponding Connection Manager ID, such as C2s, Bosh, WS configuration, and C2s configuration as an example:
C2s/cm-see-other-host/default-host=host1;host2;host3
Use semicolons to interval redirected host node names
C2s/cm-see-other-host/active=open; LOGIN
Use semicolons to interval the stage in which an end user can be redirected
The currently available values are:
Open it means that you can redirect during the opening of the XMPP stream
LOGIN It indicates that a redirect can be made during an authenticated user session
Tigase The default redirection phase is the open stage.
The options attached to the SEEOTHERHOSTDB policy include:
C2s/cm-see-other-host/db-url
The URI of the JDBC connection, which is used to query for redirection information, and if not configured, the value of –user-db-uri is used.
C2s/cm-see-other-host/get-host-query
SQL query statement, which should be able to return the redirected host name.
C2s/cm-see-other-host/get-all-data-query
A SQL helper query statement that returns all redirected data from the database.
C2s/cm-see-other-host/get-all-query-timeout
Sets the time-out for executing the query.
Copyright NOTICE: This article for Bo Master Chszs original article, without Bo Master permission not reproduced.
Tigase Load Balancing Strategy