Installing and Configuring the JAMS Failover
Before You Begin
-
Ensure you have ports 4222, 4773, and 5773 open between the two Schedulers before configuring JAMS in a failover environment. Port 4222 carries messages between the nodes and replaces MSMQ port 1801, which is no longer used. See JAMS TCP/IP Ports for the full list of ports and NATS Ports and Firewall Requirements for the messaging ports.
-
Create a firewall rule on each Scheduler to allow inbound TCP 4222, so the JAMS NATS Server on each node can accept connections from the other. Run this in an elevated PowerShell prompt on both servers:
New-NetFirewallRule -DisplayName "JAMS NATS Server" `-Direction Inbound -Protocol TCP -LocalPort 4222 -Action Allow -
Ensure the user account you use meets the following requirements:
- It is an administrator.
- It has at least the db_datawriter role, or it is a member of the JAMSApp role.
An additional license needs to be purchased to install a Failover Server. Contact your Account Manager for more details.
How the Two Schedulers Talk to Each Other
Each Scheduler runs its own JAMS NATS Server service, which carries messages between the JAMS services. The two servers secure their connections with mutual TLS, so both nodes must present certificates issued from the same root CA. The installer creates a root CA on each machine it installs, which is why the steps below export the primary's root CA, import it on the secondary, and then issue the secondary's NATS certificate from it.
The installer does this for you on the primary. On the secondary it cannot, because the shared root CA is not on that machine yet when the installer runs. It skips the Scheduler Listener, the Scheduler Connector for the JAMS Server, and the NATS certificate, and records this in DBUpdate.log:
A Default Root CA and a different Scheduler Listener are already configured, but the Root CA is not available.
The Root CA and Scheduler Listener for this machine will have to be set up manually. Review documentation on "Installing and Configuring the JAMS Failover".
The Root CA is not available. The Scheduler Connector for this machine will have to be set up manually. Review documentation on "Installing and Configuring the JAMS Failover".
The Root CA is not available. TLS will have to be set up manually. Review documentation on "Installing and Configuring the JAMS Failover".
These messages are expected on the secondary. The steps under Secondary JAMS Scheduler are the manual setup they refer to. For the details, see NATS in a Failover Environment.
Installing JAMS
- Install the JAMS Primary Scheduler.
- The Local Agent Name defaults to the name of the Primary Scheduler. Update the name of the Secondary Scheduler to localhost.

- For redundancy of the JAMS Database, you can configure AlwaysOn Availability after you complete these steps.
- Stop the JAMS Scheduler service on the JAMS Scheduler Server.
- If the primary and secondary JAMS Schedulers are to share a database, add a user to the JAMS database to allow the secondary JAMS Scheduler to connect. This can be done by running the SQL statements below on the JAMS database. 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'
-
Install the JAMS Scheduler on the secondary server.
- When prompted for the database server, enter the same SQL Server, Instance, and Database Name as the primary JAMS Scheduler server.
- Click Next. On the dialog stating "Database already exists", select Use Database.
-
Stop the JAMS Scheduler service on the secondary server.
-
Create and edit a Failover.config file in C:\Program Files\MVPSI\JAMS\Scheduler on the primary and secondary servers. A sample Failover file is shown below.
A Sample Failover config
<FailoverConfig>
<Primary>Server1</Primary>
<Secondary>Server2</Secondary>
<Port>4773</Port>
<Interval>60</Interval>
</FailoverConfig>
- The primary and secondary server names are the hostnames of the respective machines.
- The port is the port used by the primary and secondary scheduler to communicate the heartbeat connection. It also tells each Scheduler which node is active, and a passive node only forwards messages to the active node once it knows. Keep it open between the nodes.
- The interval value is the length of time that must elapse before a heartbeat is missed. If 3 heartbeats are missed, then the failover process will start.
- The interval value can be modified to suit the user's needs. It is recommended to not have this value lower than 15 seconds to ensure that the schedulers are not constantly trying to take control of the database during intermittent network issues.
Importing the Encryption Key on the Secondary JAMS Scheduler
The encryption key that protects passwords in the JAMS Database is protected separately on each node, so the secondary cannot decrypt credentials until the key is imported on it. Complete these steps after Failover.config is in place on the secondary. The JAMS Server service must be running on the secondary.
- Locate the key file for the database:
- If the installer generated the key when it created the database on the primary, use the file it saved,
<database>-<machine>-EncryptionKey.txt. By default it is in C:\Program Files\MVPSI\JAMS\Scheduler on the primary. Do not run GENERATE KEY on the primary, because it would replace the key and the saved file would no longer match. - Otherwise, generate and export a key on the primary as described in Managing Encryption Keys.
- If the installer generated the key when it created the database on the primary, use the file it saved,
- Copy the key file to C:\Program Files\MVPSI\JAMS\Scheduler on the secondary.
- On the secondary, execute JAMSDBA.EXE from that directory to open a JAMSDBA> prompt.
- Enter
IMPORT KEY YourFileName.txt Default /NOENCRYPTand press Return, replacing YourFileName.txt with the name of the key file. - Enter EXIT and press Return.
- Move the key file from both servers to a safe, secured location.
Whenever the key is changed on the primary, export it and repeat IMPORT KEY YourFileName.txt Default /NOENCRYPT on the secondary. Otherwise, the secondary cannot decrypt credentials after a failover.
Working with the Root Certificate Authority
For JAMS 7.7.3 and later, a root certificate authority is included with the JAMS installer. The steps below need to be completed on versions 7.7.3 and later. From JAMS 7.9.5, the same root CA also signs the NATS certificate on each node, so the secondary gains two commands at the end.
Primary JAMS Scheduler
- On the primary JAMS Scheduler, go to \Program Files\MVPSI\JAMS\Scheduler.
- Right-click JAMSRegister.exe and select Run as administrator. A command prompt window opens.
- Run the command shown below to export the certificate. You need to copy this to the Secondary JAMS Scheduler.
Export root ca /filename="C:\\root.pfx" /prompt - Enter a password to store the private key, which is referred to as the root key password and will be used in another step.
- Enter the password again when prompted to verify it.
- Close the JAMSRegister application.
- Copy the root.pfx file that you exported to the secondary JAMS Scheduler.
Secondary JAMS Scheduler
- On the secondary JAMS Scheduler, go to \Program Files\MVPSI\JAMS\Scheduler.
- Right-click JAMSRegister.exe and select Run as administrator. A command prompt window opens.
- Run the command shown below to import the certificate. Ensure you update the /filename command to specify the location where the file is saved.
Import root ca /filename=root.pfx /prompt /makedefault /storekey - Enter the root key password.
- Run the command shown below:
Add Scheduler Listener /NEWCERT - Create the Scheduler Connector that the JAMS Server uses to receive events from the Scheduler. Replace SecondaryServerName with the hostname of the secondary server:
Add Scheduler Connector /ReqCert /Server=SecondaryServerName /ClientName=JAMSServer - Issue the NATS certificate from the imported root CA:
Create NATS Certificate - Regenerate the NATS configuration and restart the NATS service so it uses the new certificate:
Update NATS Configuration /RESTART
The /storekey qualifier on the import is required. Without it the root CA's private key is not imported, and step 7 fails with the same "Root CA is not available" message that the installer logged. If Create NATS Certificate reports that a NATS certificate already exists, run Destroy NATS Certificate first and then repeat steps 7 and 8.
Step 6 requests the connector certificate from the JAMS Server, so the JAMS Server service must be running on the secondary. It must also come after step 5, because the connector cannot be configured until the Scheduler Listener exists. If it reports that the connector certificate already exists, run Update Scheduler Connector /ReqCert /Server=SecondaryServerName /ClientName=JAMSServer instead.
Without the connector, the JAMS Server on the secondary does not receive folder change events from the Scheduler, so folders added, changed, or removed in the Web Client do not appear automatically in the desktop client.
Create NATS Certificate only creates the certificate. It does not change the NATS configuration or restart any service. Step 8 is what makes NATS use the new certificate. Do not skip it.
Updating the Connector on the Primary JAMS Scheduler
After the Secondary JAMS Scheduler is set up, you must run the command below on the Primary JAMS Scheduler. This command enables communication between both Schedulers.
- On the primary JAMS Scheduler, go to \Program Files\MVPSI\JAMS\Scheduler.
- Right-click JAMSRegister.exe and select Run as administrator. A command prompt window opens.
- Run the command shown below. You only need to change the value for the /Server option.
Update Scheduler Connector /Server=localhost /ClientName=JAMSServer
Restarting the Services and Verifying Messaging
- Start the JAMS Scheduler on both the primary and secondary servers.
- On each Scheduler, run
List NATS Configurationin JAMSRegister. Confirm that Mutual TLS is on, that Reachable From Other Machines is yes, that Server Certificate In Store is yes, and that the Trusted CA thumbprint is the same on both nodes. - Confirm each node can reach the other's NATS server on port 4222, for example with
Test-NetConnection <OtherNode> -Port 4222. - On the secondary, run
List Client Configurationin JAMSRegister. Confirm that client JAMSServer is listed with a Scheduler URL for both nodes and with its connector certificate thumbprint, subject, issuer, and expiry. If the client is listed with no Scheduler details, the Scheduler Connector was not created. Run step 6 under Secondary JAMS Scheduler.
Granting permissions to the MSMQ service is no longer required. JAMS does not use MSMQ. For a full verification procedure and what to do if a check fails, see NATS in a Failover Environment.
NATS Certificate Commands
These JAMSRegister commands manage the NATS certificate and configuration. Run JAMSRegister as administrator from the Scheduler folder.
| Command | Purpose |
|---|---|
List NATS Certificate | Shows the JAMS NATS certificate in the Local Machine Personal store and the certificate files in the NATS folder, and whether they match. |
Create NATS Certificate | Issues a certificate from the default root CA, stores it, and writes the PEM files NATS reads to the NATS folder. |
Destroy NATS Certificate | Removes the certificate from the store. Always follow it with Create or Import. |
Export NATS Certificate | Writes the store certificate to a .pfx file with /FILENAME, or rewrites the PEM files in the NATS folder from the store with /DIRECTORYNAME, or both. |
Import NATS Certificate | Installs a JAMS NATS certificate from a .pfx file into the store, and with /DIRECTORYNAME also writes the PEM files. Use it to put a certificate issued on another machine onto this one. |
List NATS Configuration | Shows the NATS configuration in effect, including whether TLS is on, which certificate the server is using, and whether that certificate is in the store. |
Update NATS Configuration /RESTART | Regenerates the configuration and restarts NATS and the JAMS services. Run this after any certificate change. It refuses to run if the folder certificate is not in the store. |
The certificate commands take /DIRECTORYNAME=<folder> and the configuration commands take /DIRECTORY=<folder> to work with a NATS folder other than the default one alongside JAMSRegister.
The certificate lives in two places: the Local Machine Personal store, used by the JAMS services, and the PEM files in the NATS folder, used by the NATS server. List NATS Certificate shows both and reports In Certificate Store: Yes or No for the folder certificate. If it is No, the JAMS services cannot connect to NATS. When the store holds the certificate you want, run Export NATS Certificate /DIRECTORYNAME and then Update NATS Configuration /RESTART to rewrite the folder from it. Otherwise run Destroy NATS Certificate, Create NATS Certificate, and Update NATS Configuration /RESTART to re-issue. See NATS TLS Certificates.
Common Log Output Location
To have a common log output location on network share for both Primary and Secondary schedulers, see Setting a common log output location for JAMS in a Failover Environment for more information.
After you configure the location for the common log, ensure the default log location exists on the Primary and Secondary schedulers.
The NATS server on each node writes its own log to C:\Program Files\MVPSI\JAMS\Scheduler\NATS\nats-server.log. It is not part of the common log location. Certificate and configuration work done by setup is recorded in DBUpdate.log in the Scheduler folder.