Wednesday, May 4, 2016

Tibco EMS Load Balancing Configuration

 This topic deals with configuring both Primary and Load Balanced Server

Configuring Primary Server
In this we are going to use 3 files which are given below for configuring Primaryserver1) tibemsd.conf 2) routes.conf 3)factories.conf Go to location c:\tibco\ems\bin you can find the above listed files.Open
tibemsd.conf file and input the parameters with the Values
Server =EMS-SERVER1(This value can be anything)
Routing =enabled(Thisvalue should be same )
store =datastore(which contain 3 files sync-db,async-db,meta-db)Save the file and exit . Open routes.conf file
and input the parameters with the values,Note: if the paramter is not there add it.When you go to bottom of this file you will find the below parameters
 [EMS-SERVER2]
This should be there by default(Note:Ensure that this parameteris used in Load Balanced server, should be same name as that in LB Server)
url =tcp://7144 (change the default port number to yourrequirement)
zone_name =default_mhop_zone (Add this parameter and value)
zone_type =mhop (Add this parameter, the value should be mhop orshop,depends upon the requirement)save and exit this file.
Open the factories.conf file
Important Note:
## If factory’s url is specified in the form## url = tcp://7222 (or any other port number)## then it is expanded during JNDI lookup to include the default# hostname of the machine running tibemsd server, for example:
## tcp://MYHOST:7222## This enables the use of the samefactories.conf file on different# hosts. However, note that only default host name will be used. On# servers with multiple interfaces you need to use explicit host name# in factories url if it should be not the default name.## Factories using ‘localhost’ as the host name only work when the client# and server are on the same computer. You will need to replace# ‘localhost’ below with the the appropriate hostname of the machine# where the server is running.Add the following parameters, these parameters are not there in the file
 [LBTopicConnectionFactory]
url =tcp://7222|tcp://7144 (From the above note actual production scenario use url=tcp://Machine1:7222|tcp://Machine2:7144)
metric =connections
 [LBQueueConnectionFactory]  url =tcp://7222|tcp://7144 (From the above note actual production scenario use url=tcp://Machine1:7222|tcp://Machine2:7144)
metric =connections Save and exit the configuration file 
Configuration of Load Balanced server for primary server
Create LB
Directory in c:\tibco\ems\binCreate
datastore2
Directory in c:\tibco\ems\bin\LBCopy the *.conf files from c:\tibco\ems\bin to c:\tibco\ems\bin\LB (only the configuration files)Copy the datastore files from c:\tibco\ems\bin\datastore toc:\tibco\ems\bin\LB\datastore2 (There would be 3 files)Note: From Now on we will work in LB Directory
The 2 files that we are going to use for Load Balancing server is
tibemsd.conf 
and
routes.conf files
Open the file c:\tibco\ems\bin\LB\tibemsd.conf set the below parameters with appropriate values
server=Ems-server2Listen=tcp://7144users=c:/tibco/ems/bin/LB/users.conf ( Note:or go for this path “\” if the other doesn’t work)groups=c:/tibco/ems/bin/LB/groups.conf topics=c:/tibco/ems/bin/LB/topics.conf queues=c:/tibco/ems/bin/LB/queues.conf acl_list=c:/tibco/ems/bin/LB/acl.conf factories=c:/tibco/ems/bin/LB/factories.conf routes=c:/tibco/ems/bin/LB/routes.conf tibrvcm=c:/tibco/ems/bin/LB/tibrvcm.conf durables=c:/tibco/ems/bin/LB/durables.conf store=c:/tibco/ems/bin/LB/datastore2Note:The reason why we are giving this path in LB Server is because the tibemsd application knows where to look for the files when you execute tibemsd in primaryserver, but for LB Sever tibemsd application is in bin and the files for that are indifferent folder
Open routes.conf file  from location c:\tibco\ems\bin\LB\routes.conf Go to the bottom of the file and modify them as below if anything is there or add itif it is not there (Reason for this is we just copied the files that have been chaned forprimary server)
 [EMS-SERVER1]url 
=tcp://7222(This value sould be of primary server listen port)
 zone_name
=default_mhop_zone
 zone_type
=mhopSave and exit the fileRead the next post
Ems-Load Balancing Setup B
for testing the LB Servers
This post is continuation of LoadBalance Setup-A
Go to All programs>Run>type cmd You will get a command prompt window Type command:
cd c:\tibco\ems\bin
Now you will be inside bin directory
Start Primary Server:
 Type command:
tibemsd
(This is a application )
Start Second Server:
Open another command promptNavigate to the directory by entering the below command
cd c:\tibco\ems\bin
Give the following command
tibemsd -config LB\tibemsd.conf 
In Primary server window u will see ‘EMS-SERVER2’ connected to url’tcp://localhost:7144’and in second server window u willsee ‘EMS-SERVER1’ accepted from host ‘machinename’ This is post is continuation of 
LoadBalance setup-B
Which Explains about testing the Ems-LoadBalance setup is Functioning or not.Note: clients both publishers/senders or Subscribers/receivers should connect toboth the Ems-Servers using “|” URL’S so that even the primary server is deadthey can connect to the Second server .Create a Jms connection , in this specify both the url’s seperated by “
|
” .For Example:
connect tcp://localhost:7222|tcp://localhost:7144
(If you usethe same machine) You will connect to the Primaryserver.Stop the primary server by entering the command
Shutdown
in commandprompt,this will cause the server to shutdown. You will see in the primary servercommand window “Shut down complete” and in the second server commandwindow “EMS-SERVER1 disconnected”.If you connect again (by using
connect tcp://localhost:7222|tcp://localhost:7144
) you will connect to the second server.
Load Balance Testing from BW
– Start a new project- In the project, make a JMS connect (u guys know already)- Write a process for TOPIC publish (u guys know already)- Write a process for TOPIC subscribe (u guys know already)- On JMS connect, JNDI Context URL: <machine-1:port>,<machine-2:port>Example: tibjmsnaming://odreka-pc:7222, tcp://server2000:7222machine-1: odreka-pc and machine-2: server2000. Both r in Network- Run the process- Shutdown the EMS server in machine-1 by EMS Administration Tool- Look the message displayed in machine-2- Stat EMS Administration Tool in machine-2 and show the TopicN.B. When shutdown the ems server in machine-1, message was sent to themachine-2 (because of configure LB)

No comments:

Post a Comment