Configuring Clustering for CData Sync



Clustering allows multiple CData Sync installations to work together and process the same jobs with the same configurations. Workloads can be distributed horizontally across clustered Sync installations to improve scalability and ensure availability.

Overview

To take advantage of the high-availability and failover features supported in Sync, the application should be installed on multiple systems within the same server farm (the same cluster). When configured for clustering, each Sync installation in the server farm uses the same application configuration and distributes job executions between each server.

As a result, multiple instances of the application behave like a single instance, and any particular instance can go down without jeopardizing the performance of the cluster.

Configuring Sync for Clustering

After Sync has been installed on each node within the cluster, each installation should be configured to use the same Application Database and Application Data Directory. After the database and directory have been setup, navigate to the Settings page and set Enable Cluster mode to true.

Application Database

Sync uses a database to store the application data (jobs, connections, etc.) and logging information. Each instance of Sync should be configured to use the same application database to ensure that each instance has access to all the job information.

Windows Edition

To configure the application database in the Windows edition, the AppDb environment variable must be set to include the appropriate connection string and provider. To accomplish this, modify the Web.Config file in the 'www' folder of the installation directory. Within this file is a commented-out XML element called connectionStrings. Below is an example of this element:

connectionStrings>
  <add 
    name="AppDb" 
    connectionString="server=SQLSERVER_LOCATION;database=DATABASE_NAME;uid=USER_ID;password=PASSWORD;" 
    providerName="System.Data.SqlClient"
  />
</connectionStrings

Un-comment this connectionStrings element and set the 'connectionString' and 'providerName' attributes to the appropriate connection parameters for the desired database. If Sync can successfully establish a connection with this connection string, it will use this database as the application database.

Sync supports the following providers:

  • System.Data.SqlClient
  • System.Data.CData.MySQL
  • System.Data.CData.PostgreSQL

Java Edition

The Java edition can be configured in two ways:

  • With the Jetty server that is included in the application
  • With an external servlet
Embedded Java Server

When using the Java edition with the embedded Jetty server, the application database is configured in the sync.xml file found in the installation directory. Within this server configuration file, the APP_DB environment variable must be set to a JDBC connection string that contains the appropriate connection parameters for the desired database. For example:

<Call name="setInitParameter">
  <Arg>APP_DB</Arg>
  <Arg>jdbc:mysql:Server=MySQLServer;Port=3306;Database=mysql;User=user;Password=password</Arg>
</Call>

If Sync can successfully establish a connection with the APP_DB connection string, it will use that database as the application database.

External Java Server

When using the Java edition with an external servlet, the details of configuring the application database depend upon the specific servlet used. Use the syntax appropriate for the specific servlet and choose one of the following approaches to configure the server:

  • Define a JNDI datasource to include the connection properties for the target database.
  • Set the APP_DB environment variable to a JDBC connection string.

If Sync can use the JDNI datasource or APP_DB connection string to connect to a database, it will use that database as the application database.

Application Data Directory

Sync stores all configuration data and application data in a folder on disk called the data directory. When clustering, each instance of Sync should be configured to use the same data directory. This ensures that all instances are processing the same files and using the same configuration.

Windows Edition

To configure the application data directory in the Windows edition, the AppDirectory environment variable must be set to the path where the directory should be created. To accomplish this, modify the Web.Config file in the 'www' folder of the installation directory. Within this file is a commented-out XML element called AppDirectory. Below that is an element called appSettings where a custom data directory location can be specified. This is an example of the appSettings element:

appSettings>
  <add key="AppDirectory" value="C:\\directory\\subdirectory\\subdirectory\\" />
</appSettings

Un-comment this appSettings element and set the AppDirectory key value to the appropriate path on disk for the data directory. If Sync can find the path and has the appropriate permissions to read and write at the given path, it will create the data folder within the specified directory.

Embedded Java Server

When using the Java edition with the embedded Jetty server, the application database is configured in the sync.xml file found in the installation directory. Within this server configuration file, the AppDirectory environment variable must be set to the desired directory path. The following example demonstrates what this might look like when setting the data directory to a shared folder on a mounted drive:

<Call name="setInitParameter">
  <Arg>AppDirectory</Arg>
  <Arg>/mnt/shared/sync</Arg>
</Call>

If Sync can find the path and has the appropriate permissions to read and write at the given path, it will create the data folder within the specified directory.

External Java Server

When using the Java edition with an external servlet, the details of configuring the application database depend upon the specific servlet used. Use the syntax appropriate for the specific servlet and set the AppDirectory environment variable desired directory path.

If Sync can find the AppDirectory path and has the appropriate permissions to read and write at the given path, it will create the data folder within the specified directory.