In order to prevent application failure and to keep the systems running smoothly, systems are often configured and setup in a fault tolerant mode with a primary and secondary node so that if application on the primary server fails, secondary server immediately takes over the control to keep everything running transparently.
TIBCO EMS Servers are also configured in FT mode (Fault Tolerant Mode) so that secondary server may take over the control once primary server is down. In this step by step tutorial, I will teach you how you can configure TIBCO EMS Servers in Fault Tolerant mode.
In real scenarios, FT configurations are done with EMS Servers running in separate machines but in this example case, I will setup two EMS Servers on the same machine and will configure them to run in FT mode.
Step 1: Configure EMS Daemons in FT mode
In order to achieve EMS Fault Tolerance, our first task is to do the necessary configuration changes in the file tibemsd.conf
This configuration file is used by the EMS Daemon. In order to run two daemons, we need to have one separate tibemsd.conf file for both. We create two copies of this configuration file and name them as tibemsd.conf and tibemsd-1.conf respectively.
We need to have separate ports for the two EMS Server daemons. For the first, let’s use 7222 port and for the second one, we use 7224 port.
In the first configuration file (tibemsd.conf), make following changes:
- Listen port should be set as tcp://7222
- In Fault Tolerant setup section, for ft_active, specify the port of other/secondary EMS Server i.e. specify tcp://7224
For the second configuration file (tibemsd-1.conf), do the following configuration changes:
- Set Listen Port as tcp://7224
- In Fault Tolerant section, for ft_active, specify tcp://7222 (ie.e. Listen port of the primary EM Server)
Step 2: Configure Fault Tolerant Factory
Second step in configuring EM Servers in FT mode is to make changes in the file factories.conf .
Configure factories for both queues and topics with the below changes in the configuration file:
[FTTopicConnectionFactory]
type = topic
url = tcp://localhost:7222,tcp://localhost:7224[FTQueueConnectionFactory]
type = queue
url = tcp://localhost:7222,tcp://localhost:7224
Step 3: Run Primary and Secondary EMS Server
Once we are done with the configuration of our FT Pair of EMS Servers, we need to start the two servers.
Run the primary EMS Server by following command:
tibemsd.exe -config C:\tibco\EMSConfig\tibco\cfgmgmt\ems\data\tibemsd.conf
As seen in below screenshot, server has started successfully:
Now run the following command to start the secondary server:
tibemsd.exe -config C:\tibco\EMSConfig\tibco\cfgmgmt\ems\data\tibemsd-1.conf
As you can see below, secondary EMS Server has started and is in standby mode for the primary server:
Step 4: Test TIBCO EMS Servers working in FT mode
In this step, we will create a TIBCO Process and will send the request to a queue on the primary server when the server is up. In that case the request will be successfully received by the queue on primary server. In second time, we will stop primary server and send the request to same server again. Now, secondary server will pick the request and request will not fail.
The EMS Connection configuration is shown in the diagram below. This connection is to the primary server:
As you can see in the diagram below, when I ran a test process to send the request to the primary server using the above connection, process has run successfully:
Now, stop the primary server by using shutdown command.
Now if we run the same process again in order to send the request to a queue on primary server, request will be processed successfully by the secondary EM Server which was in standby mode.
I am very interesting in Tibco.
I am requesting to you sir please send me tibco materials, videos, Interview questions, Realtime scenarios do you have any please send me sir.
hello sir,
i also need the same information
your explanation is so nice .i need clear idea of ftp, tcp palette of tibco bw with all activites of FTP,TCP…..
Hi Ajmal
In the advanced tab of jms connection pallete, I think one has to specify queue connection factory as “FTqueueconnectionFactory” tring that is specified in factories.config file. Pls let me know if my understanding is correct.
Sir, Kindly Requesting you that Please send me the Ems Material….
Nice Explanation
My primary server runs just fine but when I run the secondary server, it doesnt goes in standby mode. It rather becomes active. Can you explain why?
what is use of routing in EMS ft,as we know routing is to connected in 2 different servers, but in EMS Ft am not clear,can you please tell us what is the of routing in EMS FT
EMS FT is used to achieve Fault Tolerance so that if your primary EMS Server goes down; secondary EMS Server takes control and your applications continue seamlessly without any outages.
Hi Ajmal,
only one connection is enough (primay connection) in this case
Thanks nice explanation. If I have two UNIX box located in two different datacenter.
1.Could you please share step configure database store.
2. What should we do if like to use file based ft mode. Do we need dedicated shared state hardware or it is possible to achieve some other way.
in Tibco EMS FT , what is use of routing, because routing we used to communicate accros the two different server, but why we need to enable the routing while doing FT configuration in tibco ems ?, can anyone tell..Thanks in advance..
Regards
Kishor
Dear Kishor,
For EMS FT setup; routing is not required. The routing steps were mentioned in the tutorial mistakenly which have been removed now. Thanks
Hi Abbasi,
Thanks for making correction in document and clearing my concept.
Regards
Kishor Ugale
Hi Team,
I think, Provider URL should be,
“tcp://localhost:7224,tcp://localhost:7222”
Or it should be “tibjmsnaming://localhost:7224,tibjmsnaming://localhost:7222” if using JNDI Connection factory.
Thanx,
-Swapnil
I think, Provider URL should be,
“tcp://localhost:7224,tcp://localhost:7222”
Regards,
Md Raish.
Yes, it is needed
Hi Ajmal,
Could you tell if this is a Master-Slave config or a peer to peer setup.
Also where do we configure this.
Regards,
Suphil Philip
Hi Ajmal,
Secondary server is getting activated (it is showing “server activating on failure of ‘tcp://7222’ )when i am shutting down the primary server but on trying to execute the process i am receiving connection failed error . Why secondary server is not taking the control ?
Use tcp://localhost:7224,tcp://localhost:7222 instead of one connection.
why we set different port ?
Just because I had two ems instances on the same machine.
Hi Ajmal,
Can explain how to set up FT configuration for ssl configured ems servers?
I tried the above mentioned steps but for ssl servers it did not work.
Thanks in Advance,
Hi Ajmal..Can you please help with my Query?
What happens if secondary Machine also crashes?
That’s a disaster case. If you have only one pair of machines in FT Mode and the complete pair fails, you will have disaster.
Hello Ajmal
When I try to run tibemsd.exe on the secondary conf file, it is unable to find the primary active connection even though it is already running. Th console also shows below error
ERROR: Unable to open store file ‘D:/TIBCOHOME_5.10/ems/datastore\async-msgs.db’, file may be locked.
Can you suggest what is the issue?
Hello sir,
I also worked with TIBCO hawk project n tibbr project have sound knowledge on ems rv active space . This is useful information
Can we use single port to both ems server instead of we are using two port like 7222 and 7224. If yes can you explain how .
In one system, you can’t use one port for two services. However, if you use two different machines; you can use same port on both.
Hi Amjal,
I have EMS configured for FT, but hrb is connecting to secondary server instead primary EMS. I have checked rulebases but can not resolve it. thanks in advance.