High Availability Installation

Follow
The Benefits of a JAMS Failover Scheduler

In many instances, it is beneficial to ensure a secondary Failover environment has been configured for your JAMS installation. The Failover ensures that there is a completely redundant instance of JAMS residing on a secondary server, often times offsite, relying on a heartbeat connection between the two.

By default, this heartbeat is set to a 60 second interval. In the event the Failover does not get a response from the Primary within 3 consecutive beats, the Failover will takeover as the Primary scheduler ensuring that the schedule continues unharmed.
 
JAMS Failover Architecture 
The JAMS Failover Architecture should consist of at least three servers:
  • JAMS Primary Scheduler Server
  • JAMS Failover Scheduler Server
  • JAMS Agent Server(s), where Jobs are run

In the event of a failure, the Failover Scheduler will take over for the Primary Scheduler, ensuring the schedule of Jobs remains intact. If Jobs are executing locally on the Primary Scheduler Server, a failure would result in the failure of all Jobs executing on the Scheduler server. Running Jobs on JAMS Agent Server(s) insulates those Jobs from Primary Scheduler Server failure. To further insulate the executing JAMS Jobs from server failure, the JAMS Agent can be configured in a cluster. 

 

Installing and Configuring the JAMS Failover
  1. Note: An additional license will need to be purchased if you wish to install a Failover Server. Please contact your Account Manager for more details.
  2. Begin by stepping through the normal installation of the JAMS Primary Engine.
  3. For redundancy of the JAMS Database, you can configure AlwaysOn Availability (which replaced Database Mirroring as of SQL Server 2012), after you complete these instructions.
  4. At this point, please be sure to stop the JAMS Scheduler service on the Primary Engine machine.
  5. Next, begin by installing the JAMS Scheduler on the second node; when prompted for the database server, specify the same SQL Server, Instance and Database Name identically to the Primary JAMS Engine. Upon hitting Next, a dialog will appear stating “Database already exists”. Be sure to select “Use Database.”
  6. As done on the Primary Server, stop the JAMS Scheduler service on the secondary server.
  7. Create/Edit a Failover.config file (sample is displayed below) in the <Root Install>\MVPSI\JAMS\Scheduler directory on the Primary server - by default: C:\Program Files\MVPSI\JAMS\Scheduler\
  8. Copy the completed Failover.config from the Primary Engine to the Secondary Failover server. Please ensure the Failover.config is identical on both servers.
  9. Next, start the JAMS Scheduler server on both the Primary and Failover machine.
  10. Lastly, if the Primary and Failover are sharing a database, it is necessary to add a user to the JAMS database to allow the Secondary engine to connect. This can be done by running the following SQL statements on the JAMS database (Note: Be sure to replace the login name with your machine name):

     

    exec sp_grantlogin @loginame='YourDomain\YourMachineName$'
    exec sp_grantdbaccess @loginame='YourDomain\YourMachineName$', @name_in_db='JAMSMachine2'
    exec sp_addrolemember @rolename='JAMSApp', @membername='JAMSMachine2'

     

Sample Failover.config

<FailoverConfig>
 <Primary>Server1</Primary>
 <Secondary>Server2</Secondary>
 <Port>4773</Port>
  <Interval>60</Interval>
</FailoverConfig>

 

Common Log Output location

If wishing to have a common log output location on network share for both Primary and Secondary schedulers please see this solution's article.

Setting a common log output location for JAMS in a Failover Environment

JAMS in a DR Site

If wishing to install JAMS in a completely separate Disaster Recovery site to allow jobs to run in the event of the loss of your Primary JAMS Server and Database, please note:

  • The scheduler is installed on a completely separate server, and installed to its own database - the JAMS Services on the DR scheduler are left stopped.
  • The DR database is mirrored using SQL log shipping or mirroring services (also known as High Availability as of SQL 2012), and replication of the SQL DB takes place from Production to DR.

During a DR Scenario, the following must take place:

  • The Services on the Production scheduler must be brought down.
  • The direction of the Mirroring or Log Shipping must be switched to "DR to Production" from "Production to DR," this is handled within SQL itself.
  • The Failover table in the DR Database must be truncated to allow the DR Scheduler to gain control over its own Database.
  • The Scheduler will look to see if there is a JAMS GUID in the Failover table, and will not take control of the DB if another GUID is present.  
  • The Services can be started on the DR Scheduler, and the DR Scheduler will pick up the execution of Jobs utilizing the replicated information in its own DB.

 

Also see:

How to grant permissions to the MSMQ service from a Secondary JAMS Scheduler

By granting access to MSMQ queues on each Scheduling Engine, jobs can be submitted transparently to the either the Primary or Secondary Engine.
Have more questions? Submit a request

Comments