In many instances, it is beneficial to ensure a secondary Failover environment has been configured for the 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.
- 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.
- Note: An additional license will need to be purchased to install a Failover Server. Please contact your Account Manager for more details.
- Begin by stepping through the normal installation of the JAMS Primary Engine.
- For redundancy of the JAMS Database, you can configure AlwaysOn Availability (which replaced Database Mirroring as of SQL Server 2012), after completing these instructions.
- At this point, please be sure to stop the JAMS Scheduler service on the Primary Engine machine.
- 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.”
- As done on the Primary Server, stop the JAMS Scheduler service on the secondary server.
- Create/Edit a Failover.config file (sample is displayed below) in the <Root Install>\MVPSI\JAMS\Scheduler directory on the Primary server - by default:
- Copy the completed Failover.config from the Primary Engine to the Secondary Failover server. Please ensure the Failover.config is identical on both servers.
- Next, start the JAMS Scheduler server on both the Primary and Failover machine.
- 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 the 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'
<FailoverConfig> <Primary>Server1</Primary> <Secondary>Server2</Secondary> <Port>4773</Port> <Interval>60</Interval> </FailoverConfig>
Common Log Output location
To have a common log output location on network share for both Primary and Secondary schedulers please see this article's solution.
Note: After configuring the Common Log Output location, ensure that the default log location exists on both Primary and Secondary schedulers.
JAMS in a DR Site
Installing JAMS in a completely separate Disaster Recovery site allows jobs to run in the event that the Primary JAMS Server and Database are lost. Note the following about DR:
- 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.