Failover Service for Key Manager Plus - MS SQL Server Cluster

The Failover Service in Key Manager Plus ensures service availability by automatically switching operations to the standby server when the primary server becomes unavailable. It uses two Key Manager Plus server instances (primary and standby) that share a common MS SQL Server cluster as the backend database, enabling the standby server to take over and maintain service continuity in the event of a primary server failure.

Additional Details

  • The Failover Service is supported only on Windows installations of Key Manager Plus.
  • A maximum of two Key Manager Plus instances (primary and standby servers) can be configured in a failover setup.

This document covers the following topics:

1. How Does the Failover Service Work?

In this setup, Key Manager Plus uses two server instances connected to a shared MS SQL cluster to ensure high availability.

  1. Primary and Standby Servers: Two Key Manager Plus instances are deployed on separate machines. One acts as the primary server, while the other functions as the standby server.
  2. Shared Database: Both servers connect to a common MS SQL cluster, ensuring consistent data access across instances.
  3. Automatic Failover: Under normal conditions, the primary server handles all operations. If the primary server goes down, the standby server automatically starts and takes over operations.
  4. Automatic Role Reversal: When the primary server is restored, it automatically switches to the standby role, while the active server continues as the primary.
  5. Single Access Point: Both servers are bound to a common static IP address, allowing users to access Key Manager Plus through the same endpoint regardless of which server is active.

2. Prerequisites

Before configuring the Failover Service, ensure the following:

  • Both primary and standby servers should run the same version of Key Manager Plus and use a compatible system architecture (32-bit or 64-bit).
  • A common static IP address should be configured for the primary server and standby server, ensuring that it is not assigned to any other machine on the network.
  • All three machines (the primary server, standby server, and SQL cluster), along with the common IP address, should be within the same subnet.

3. Configuring Failover Service

3.1 Install Primary and Standby Servers

Install Key Manager Plus on two machines, one to serve as the primary server and the other as the standby server. You can designate the roles of the two servers later during the configuration process.

3.2 Configure Database

The Failover Service requires MS SQL as the backend database. To configure MS SQL as your backend database, refer to this help documentation.

3.3 Configure Failover Service in Primary Server

Follow the steps below to configure the Failover Service on the server designated as the primary server:

  1. Stop the Key Manager Plus service on the primary server.
  2. Open the command prompt with administrative privileges, and navigate to <Key-Manager-Plus-Installation-Directory>/bin directory.
  3. Run the script: FOSSetup.bat. In the configuration window that appears, enter the following details:
    1. Common IP - Enter the configured common IP address. This ensures users can connect using the same IP regardless of which server is active.
    2. Common IP Netmask - Enter the subnet mask corresponding to the common IP.
    3. Standby IP - Enter the IP address of the standby server to establish communication between the servers.
    4. Network Connection Type - Select the network interface used for communication between the primary and standby servers.
      failover-service-1
  4. Click Save. A ZIP file named FOSPack.zip will be created under <Key Manager Plus Primary Installation Folder>/FailoverService. This file contains the Failover Service configuration and is required for configuring the standby server.
    failover-service-2
  5. Copy the FOSPack.zip file from the primary server and place it in the Key Manager Plus installation home directory on the standby server.

3.4 Configure the Failover Service on the Standby Server

Follow the steps below to configure the Failover Service on the server designated as the standby server:

  1. Open the command prompt with administrative privileges and navigate to <Key-Manager-Plus-Installation-Directory>/bin.
  2. Execute the following command:
    ConfigureStandbyFOS.bat <path_to_FOSPack.zip>
    failover-service-3
  3. Once the FOS settings pack has been unzipped and installed in the Standby server, copy the kmp_key.key file, which contains the master encryption key, from the primary server to the standby server. Then, update the file path in <Key Manager Plus installation folder>/conf/manage_key.conf on the standby server to point to the copied file.

    Additional Details

    • Key Manager Plus License: When the FOS settings file is unzipped on the standby server, the Key Manager Plus license will automatically reflect on the standby server. The standby server does not require a separate license file. However, if the Key Manager Plus license is updated in the future, it will not automatically reflect on the standby server. Apply the license file on the standby server separately.
    • Installing server certificate for standby server: To get the standby server running, import the server certificate from the primary server into the standby server. To do this, open the command prompt, navigate to <Key Manager Plus Secondary Installation Folder>/bin, and execute the command: importcert.bat <server_certificate_path>. The server certificate should be a .cer file.

3.5 Start the Failover Service on Primary and Standby Servers

After configuring the Failover Service on both servers, start the Key Manager Plus service from the Windows Services panel. The application can be accessed via the common static IP at https://<Common IP>:<Port>. If the primary server goes down, the standby server will automatically start and take over.

4. Uninstalling the Failover Service

To deactivate the Failover Service from either the Primary or Standby server, run the UninstallFOS.bat script from the <Key-Manager-Plus-Installation-Directory>/bin folder. Upon deactivation, Key Manager Plus can be uninstalled from the other server.




Top