Switching Primary and Secondary with CM's
Posted in 2017
Topics: General Discussion
Hi all, Is is possible to switch from secondary to primary and the other way when you have a CM in proxy mode ? I mean, to be able to switch I must bring down the CM and applications connect to db through cm in proxy mode so if cm is down, how the applications will connect while switching since they don't know where to connect ? Thank you.
R Mchael,You may not need to bring down CM and apps at all if you set it up this way. Pay attention to 3 configuration files: onconfig, sqlhosts, your_cmconfigfile.cfg (both primary and secondary should be almost identical anyway). * The onconfig files should have: Primary's onconfig DBSERVERNAME ifmxserver1170 DRAUTO 2 Secondary's onconfig DBSERVERNAME ifmxserver1170hdr DRAUTO 2 *The sqlhosts should both have an additional entry, for example: oltp onsoctcp 192.168.1.151 50004 * "your_cmconfigfile.cfg" should have # Connection Manager name NAME cm_example SLA oltp=primary+HDR FOC ifmxserver1170hdr,10 (10 means to wait 10 seconds) OPERATION:All applications should connect to "oltp" (NOT ifmxserver1170)with DRAUTO=2, when primary is down,secondary will be primary. When you bring the originalprimary up, it will be secondary.Ifyou want it to be back as primary, you will need to then bounce the secondary(which is currentlyas primary) this will automatically switch server type. This works beautifully in my test, hope this helps! Let's go GreenThis email contains 100% recycled electrons. From: R MICHAEL <mboncalo@gmail.com> To: ids@iiug.org Sent: Wednesday, March 8, 2017 11:27 AM Subject: Switching Primary and Secondary with CM's [38726] Hi all, Is is possible to switch from secondary to primary and the other way when you have a CM in proxy mode ? I mean, to be able to switch I must bring down the CM and applications connect to db through cm in proxy mode so if cm is down, how the applications will connect while switching since they don't know where to connect ? Thank you. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Since CM is arbitrating the failover, drauto value is 3, so it's another case compared to what you've told me. Yes, it's possible to switch when drauto is 2 but my case is different:drauto 3 - proxy mode
That is a good point, I will need to test this out (DRAUTO=3 with CM) -- unfortunately I don't have a test environment to do so. Let us know if you find out any thing later. Let's go GreenThis email contains 100% recycled electrons. From: R MICHAEL <mboncalo@gmail.com> To: ids@iiug.org Sent: Wednesday, March 8, 2017 5:21 PM Subject: Re: Switching Primary and Secondary with CM's [38728] Since CM is arbitrating the failover, drauto value is 3, so it's another case compared to what you've told me. Yes, it's possible to switch when drauto is 2 but my case is different:drauto 3 - proxy mode ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.