Sunday, December 18, 2011

Configuring TIBCO EMS: Load Balancing

Configure the Daemon: You can start with one of the existing tibemsd.conf files and you will need to modify the server, store, listen, ft_active, routing and routes elements.


Server is the name of the EMS Server, and it needs to be distinct from other members of the LB group. In this case, we have chosen EMS-SERVER1. Since we will be building everything on a single host with two LB members each in a FT pair, we need to create another FT pair. In this case, we are using ports 7122 and 7124 with server EMS-SERVER1, a new store, and a new routes element (more on routes later).

The configuration approach is the same for building a FT Pair, by swapping listen and ft_active ports. The difference is that this is a new instance of FT and needs a unique name and storage. Routes need to be different as one cannot route to oneself.


The parameters we will be using as follows:
server = EMS-SERVER1
store = datastorelb
listen = tcp://7122
ft_active = tcp://7124
routing = enabled
routes = routes2.conf

Configure the Load-Balanced Factories (incl. FT pairs): In a similar fashion, you can edit the factories.conf file or enter the new factories via the EMS Administration Tool. The difference is the syntax where a vertical bar, or pipe, is used to delimit the two fault-tolerant pairs.


[LBTopicConnectionFactory]
type = topic url = tcp://7222, tcp://7224 tcp://7122, tcp://7124
metric = connections
[LBQueueConnectionFactory]
type = queue url = tcp://7222, tcp://7224 tcp://7122, tcp://7124
metric = connections


These URLs combine FT and LB. With Load-Balancing, you have the element of metric which can be either connections or byte_rate. The client will retrieve the URL based on request of a particular Factory, and if it is a load-balanced URL, it will query each participant for the value of the metric and the client will make the connection appropriate to the metric.


Enable Routing: You MUST route messages between LB servers, and if using FT pairs, you need to specify a FT URL. As you cannot route to yourself, and keeping in mind that Queues can only have one hop, you must configure routes appropriately.
The routes.conf file for EMS-Server will point to EMS-SERVER1 and use the FT URL for that pair, as follows:

[EMS-SERVER1] url = tcp://7122, tcp://7124


zone_name = default_mhop_zone


zone_type = mhop


Since we pointed EMS-SERVER1 to routes2.conf, it will look like this:
[EMS-SERVER]


url = tcp://7222, tcp://7224


zone_name = default_mhop_zone


zone_type = mhop


See the EMS documentation for more information on Zones and Zone-types. For this example, we can take the default. These entries can be created through the EMS Adminstration Tool as well:

create route EMS-SERVER1 url=tcp://7122,tcp//7124


Topics/Queues with Routing

Set Global Attribute: The Global Attribute can be applied to both topics and queues and permits messages to flow between members participating in Load Balancing. You can modify existing topics and queues, or when you create new ones, the syntax is as follows:

tcp://localhost:7222) create topic foo.bar global

Topic 'foo.bar' has been created

tcp://localhost:7222) commit

Configuration has been saved

As Queues can only be “one hop” away, you need to designate a “home”. When you configure a queue on a non-home provider, you point to the home with the following syntax, where you specify the home provider for the queue:

0 comments:

Popular Posts

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP