> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up the Processing Server in a failover cluster

> Set up the ABBYY FlexiCapture Processing Server in a Windows failover cluster, covering hardware, shared storage, the generic service, and cluster nodes.

For the Processing Server, failover clusters are used. For detailed instructions on creating a failover cluster, refer to [this page on the Microsoft website](https://docs.microsoft.com/en-us/windows-server/failover-clustering/create-failover-cluster).

## <a id="requirements-cluster" />Hardware requirements

### Cluster nodes

* All cluster nodes must have identical or essentially similar hardware configuration.
* All cluster nodes must be running the same version of Windows Server.
* All cluster nodes must be joined to the same Active Directory domain, or Basic authentication must be configured for the Processing Server (see [Description of Processing Server commands](/flexi-capture/appendix/proc-server-cmd) for detailed instructions).

### Shared storage

Shared storage stores a folder containing the files required by the cluster. The disk must meet the following requirements:

* The disk must be connected using Serial Attached SCSI (SAS), iSCSI, or Fibre Channel.
* The disk must be accessible to all cluster nodes.
* The disk must not be used as a boot or system volume.
* The disk must not be used for swap, dump, or hibernation files.

The following are the most commonly used cluster storage solutions:

* Ready-made storage systems based on DAS, SAN, NAS, JBOD, or other technologies.
* A separate server machine for which the [iSCSI Target Server](https://docs.microsoft.com/en-us/system-center/vmm/storage-iscsi?view=sc-vmm-1807) role has been set up.

For detailed clustering hardware requirements, refer to [this page on the Microsoft website](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/jj612869\(v=ws.11\)).

## Set up the Processing Server in a failover cluster

To set up the Processing Server in a failover cluster, complete the following steps:

1. [Create a failover cluster](#nodes-to-cluster).
2. [Basic configuration of the failover cluster](#basic-config).
3. [Add the ABBYY FlexiCapture Processing Server service](#adding-service).
4. [Create a shared folder for the Processing Server service](#network-folder).
5. [Configure the cluster nodes](#nodes).

<Note>
  The addresses, computer names, domain names, and so on used in the following sections are not mandatory and may be changed by the administrator. The server configuration described here is intended only for local use in a local area network.
</Note>

<Warning>
  The names of servers, services, and shared folders must not contain spaces.
</Warning>

### <a id="nodes-to-cluster" />Create a failover cluster

To cluster two machines, complete the following steps:

<Steps>
  <Step title="Check the hardware requirements">
    Check that you have all the necessary components in place and that they meet the [hardware requirements](#requirements-cluster) listed above.
  </Step>

  <Step title="Install the Failover Clustering feature">
    Install the Failover Clustering feature.
  </Step>

  <Step title="Validate the configuration">
    Validate the configuration to make sure that it is suitable for failover clustering.
  </Step>

  <Step title="Create the failover cluster">
    Create a failover cluster.
  </Step>
</Steps>

<Note>
  If your cluster has an even number of nodes, we strongly recommend using a quorum configuration with a witness resource (for example, a Disk Witness, a Share Witness, or a Cloud Witness); otherwise, the cluster will cease to function if half of its nodes fail. For detailed instructions, see the Configure the cluster quorum settings section on this page of the Microsoft website.
</Note>

Detailed information about failover clustering is available on [this page of the Microsoft website](https://docs.microsoft.com/en-us/windows-server/failover-clustering/create-failover-cluster).

### <a id="basic-config" />Basic configuration of the failover cluster

This example uses a previously created FOC cluster (FOC.cluster2016.ru), located in the 192.168.0.0/23 designated network in the cluster2016.ru domain.

The cluster consists of two nodes, Node1 and Node2.

#### Addressing in the cluster

The Node1 and Node2 nodes have two network interfaces. One of them belongs to the 192.168.0.0/23 network and the other may belong to a local area network (for example 10.0.2.0/24). The data storage only interfaces with the 192.168.0.0/23 network and is available only to the cluster nodes (that is, Node1 and Node2).

Both networks are available to the cluster FOC.cluster2016.ru. Cluster traffic should only be allowed in the designated network 192.168.0.0/23 for security and workload balancing reasons. External users can access the data storage through requests to Node1 and Node2. To allow cluster traffic in the 192.168.0.0/23 network, open the **Failover Cluster Manager**, select **Cluster Network** in the **Networks** group, and choose **Cluster and Client** in the **Cluster Use** column (see the screenshot below).

<Frame>
  <img src="https://mintcdn.com/abbyy/M5jnw37NmJ-asKkj/images/flexi-capture/clasters1.png?fit=max&auto=format&n=M5jnw37NmJ-asKkj&q=85&s=b1484c34ad57628dd6aba57902dbf3be" alt="Screenshot of the Networks view in Failover Cluster Manager, where the Cluster Network in the 192.168.0.0/23 subnet is set to Cluster and Client in the Cluster Use column." width="1046" height="807" data-path="images/flexi-capture/clasters1.png" />
</Frame>

Interfaces and their networks:

| **Interface**  | **Network**     | **Description**                                                                                              |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| FOC            | 192.168.0.10/23 | The cluster in the cluster2016.ru domain. Comprises two nodes.                                               |
| FC12ProcServer | 192.168.0.9/23  | The address of the ABBYY FlexiCapture Processing Server service that [runs in the cluster](#adding-service). |
| Storage        | 192.168.0.1/23  | [File storage](#network-folder).                                                                             |
| Node1          | 192.168.0.11/23 | [First cluster node](#nodes).                                                                                |
| Node2          | 192.168.0.12/23 | [Second cluster node](#nodes).                                                                               |

#### Domain users

To set up domain user accounts:

1. Create two domain users, for example, cluster2016\node1admin and cluster2016\node2admin.
2. Give administrator rights to cluster2016\node1admin on Node1 and to cluster2016\node2admin on Node2.

<Note>
  These user accounts are used only for working with ABBYY FlexiCapture in a failover cluster, to ensure correct usage of shared network resources. Clustering requires domain accounts; you cannot work under a local user account.
</Note>

### <a id="adding-service" />Add the ABBYY FlexiCapture Processing Server service

Install ABBYY FlexiCapture Processing Server on Node1 and Node2, and then create a shared folder (see below) for the FlexiCapture service.

To create the service, complete the following steps:

<Steps>
  <Step title="Configure the role">
    Right-click the **Roles** group and choose **Configure Role…**.
  </Step>

  <Step title="Select Generic Service">
    Select **Generic Service** from the list of services and click **Next**.
  </Step>

  <Step title="Choose the Processing Server service">
    Choose ABBYY FlexiCapture 12 Processing Server from the list of available services and click **Next**.
  </Step>

  <Step title="Name the service">
    Enter the name of the service (`FC12ProcServer` in this example). The IP address will be generated automatically. Click **Next**.
  </Step>

  <Step title="Choose the storage volume">
    Choose the volume you created for centralized storage and click **Next**.
  </Step>

  <Step title="Specify the registry key">
    Specify the registry key `HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ABBYY\FlexiCapture\12.0` (see the screenshot below).
  </Step>

  <Step title="Confirm and finish">
    Click **Next** to confirm the settings, and then click **Finish** to complete the creation of the service in the cluster.
  </Step>
</Steps>

### <a id="network-folder" />Create a shared folder for the Processing Server service

Create a shared folder for the newly created service, where the temporary files for Node1 and Node2 will be stored.

<Warning>
  The network folder configuration described here is not fail-safe: if the storage fails, the cluster will go down. To ensure continuous operation of the cluster, you need to make your file storage fail-safe. See [Set up a distributed file system](/flexi-capture/fail-safety-dfs) for detailed instructions.
</Warning>

To create a shared folder, complete the following steps:

<Steps>
  <Step title="Start the Add File Share wizard">
    Select **Add File Share** in the local menu of the newly created service (`FC12ProcServer` in this example).

    <Frame>
      <img src="https://mintcdn.com/abbyy/M5jnw37NmJ-asKkj/images/flexi-capture/clasters10.png?fit=max&auto=format&n=M5jnw37NmJ-asKkj&q=85&s=a8836f0a85f443a86a1e2729a3705926" alt="Screenshot of Failover Cluster Manager showing the shortcut menu for the FC12ProcServer role with the Add File Share command highlighted." width="1046" height="805" data-path="images/flexi-capture/clasters10.png" />
    </Frame>
  </Step>

  <Step title="Select the SMB Share profile">
    Select the **SMB Share – Applications** profile.
  </Step>

  <Step title="Specify the folder location">
    Specify a location for the shared folder (**Select by volume** is the default option).
  </Step>

  <Step title="Name the shared folder">
    If necessary, enter a name and description for the shared folder and click **Next**.
  </Step>

  <Step title="Keep the default settings">
    On the **Other Settings** tab, keep the default values and click **Next**.
  </Step>

  <Step title="Customize folder permissions">
    Specify folder permissions for the previously created domain users ([node1admin@cluster2016.ru](mailto:node1admin@cluster2016.ru) and [node2admin@cluster2016.ru](mailto:node2admin@cluster2016.ru)). To do this, click **Customize permissions…**.
  </Step>

  <Step title="Grant full control to each user">
    Click **Add**, and then click **Select a principal**. Select a user and click **OK**. Under **Basic permissions**, select the **Full control** option and click **OK**. Repeat these steps for the node2admin user and click **OK**.
  </Step>

  <Step title="Create the share">
    Click **Next**, check that the specified settings are correct, and click **Create**. Once the shared folder is successfully created, click **Close**.
  </Step>
</Steps>

## <a id="nodes" />Configure the cluster nodes

Next you need to set up the Node1 and Node2 cluster nodes. The instructions that follow are for Node1. Node2 is set up identically.

### <a id="procserv-local-setup" />Set up the ABBYY FlexiCapture Processing Server service

<Steps>
  <Step title="Configure the service from the command line">
    Enter the following command in the command line (cmd.exe):

    ```
    sc config ABBYY.ProcServer.FlexiCapture.12.0 binpath= "%systemdrive%\Program Files\ABBYY FlexiCapture 12 Servers\FlexiBRSvc.exe" \service -stationType:server -inifile:\\FC12procserver\ClusterTemp\ServerSettings.xml
    ```

    <Warning>
      Copying and pasting the above command may introduce redundant new line characters, resulting in an error. If this is the case, type the command manually.
    </Warning>

    This command changes the default settings for the `ABBYY.ProcServer.FlexiCapture.12` process, which is launched from the file `%systemdrive%\Program Files\ABBYY FlexiCapture 12 Servers\FlexiBRSvc.exe` and sets the path to the file that contains the settings for the Processing Server: `\\FC12procserver\ClusterTemp\ServerSettings.xml`. The `ServerSettings.xml` file is then stored in the shared folder and is available to all nodes in the cluster.

    <Note>
      The `ServerSettings.xml` file contains the Processing Server settings. If this file is not found when you start the Processing Server, it is started with the default settings and a new `ServerSettings.xml` is created.
    </Note>
  </Step>

  <Step title="Open the service properties">
    Find the ABBYY FlexiCapture 12 Processing Server service in the list of services (**Start → Administrative Tools → Services**), right-click the service, and select **Properties**.
  </Step>

  <Step title="Verify the path to the executable">
    Make sure that the parameters you typed in the command line are displayed in the **Path to executable** field.
  </Step>

  <Step title="Set the Log On account">
    Click the **Log On** tab. For Node1, change the user NetworkService to node1admin. For Node2, change the user NetworkService to node2admin. Click **OK**.
  </Step>
</Steps>

### <a id="appdata-changing" />Change the %appdata% variable

The `ABBYY.ProcServer.FlexiCapture.12.0` service creates and stores session data in the location referenced by the `%appdata%` variable. The node1admin and node2admin users must have the same folder specified for `%appdata%` in order for the service to switch between the cluster nodes.

<Warning>
  For the cluster2016\node1admin user, the `%appdata%` variable must be changed on Node1. For the cluster2016\node2admin user, the `%appdata%` variable must be changed on Node2.
</Warning>

You can change the `%appdata%` variable via the command line or directly in the Windows registry.

To change `%appdata%` via the command line:

<Steps>
  <Step title="Run the REG ADD command">
    Enter the following command in the command line (cmd.exe):

    ```
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v AppData /t REG_EXPAND_SZ /d \\FC12ProcServer\ClusterTemp
    ```

    where `\\FC12ProcServer\ClusterTemp` should be replaced with the path to your folder.

    <Warning>
      Copying and pasting the above command may introduce redundant new line characters, resulting in an error. If this is the case, type the command manually.
    </Warning>
  </Step>

  <Step title="Confirm the change">
    Confirm that you want to change the `AppData` folder if it already exists.
  </Step>

  <Step title="Repeat for Node2">
    Repeat the previous steps for Node2.
  </Step>
</Steps>

To change `%appdata%` directly in the Windows registry:

<Steps>
  <Step title="Find the User Shell Folders key">
    Find the key `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders` in the registry.
  </Step>

  <Step title="Set the AppData value">
    If no such key exists, create a `REG_EXPAND_SZ` type variable named `AppData` in this key and set its value to `\\FC12ProcServer\ClusterTemp`.
  </Step>

  <Step title="Repeat for Node2">
    Repeat the previous steps for Node2.
  </Step>
</Steps>

### Connect the Processing Server Monitor

To connect the Processing Server Monitor, select a node for the `FC12ProcServer` service, and then open the Processing Server Monitor on any computer in your LAN and add the clustered Processing Server.
