Cluster Installation and Configuration

Version 22.0.8342


Cluster Installation and Configuration


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

Understanding Clustering

To take advantage of the high-availability and failover features that are supported in Sync, the application should be installed on multiple systems within the same server farm (the same cluster). When they are 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 fail without jeopardizing the performance of the cluster.

Configuring CData Sync for Clustering

After you install Sync on each node within a cluster, you should configure each installation to use the same application database and application data directory. After you set up the database and directory, navigate to the Settings > Advanced in Sync and set the Enable Cluster mode to True.

Application Directory

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

Windows Edition

To configure the application data directory in the Windows edition, you must set the AppDirectory environment variable 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 (InstallationDirectory). This file contains an XML element called AppDirectory that is commented out. Below AppDirectory is an element called appSettings where you can specify a custom data-directory location. An example of the appSettings element is shown below:

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

Remove the comment delimiters from appSettings element and set the AppDirectory key value to the appropriate path on the disk for the data directory. If Sync can locate the path and it has the appropriate permissions to read and write at that location, it creates the data folder within the specified directory.

Embedded Java Server

When you use the Java edition with the embedded Jetty server, the application database is configured in the sync.properties file that resides in InstallationDirectory. Within this server configuration file, you must set the AppDirectory environment variable to the directory path that you want. The following example demonstrates what this might look like when you set the data directory to a shared folder on a mounted drive:

cdata.app.directory=/mnt/shared/sync

If Sync can locate the path and it has the appropriate permissions to read and write at that location, it creates the data folder within the specified directory.

External Java Server

When you use the Java edition with an external servlet, the details of configuring the application database depend upon the specific servlet that you use. Use the syntax that is appropriate for the specific servlet and set the AppDirectory environment variable to the directory path that you want.

If Sync can find the AppDirectory path and it has the appropriate permissions to read and write at that location, it creates the data folder within the specified directory.

Application Database

Sync uses a database to store the application data (jobs, connections, and so on) and logging information. You should configure each instance of Sync to use the same application database. Doing so ensure that each instance can access all the job information.

Windows Edition

To configure the application database in the Windows edition, you must set the AppDb environment variable to include the appropriate connection string and provider. To accomplish this, modify the Web.Config file in the www folder of the installation directory. This file contains an XML element called connectionStrings that is commented out. An example of the connectionStrings element is shown below:

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

Remove the comment delimiters from the connectionStrings element and set the connectionString and providerName attributes to the appropriate connection parameters for the database that you want to use. If Sync can establish a connection successfully with this connection string, it uses this database as the application database.

Sync supports the following providers:

  • System.Data.SqlClient

  • System.Data.CData.MySQL

  • System.Data.CData.PostgreSQL

Java Edition

You can configure the Java edition in two ways:

  • With the Jetty server that is included in the application

  • With an external servlet

Embedded Java Server

When you use the Java edition with the embedded Jetty server, the application database is configured in the sync.properties file that resides in InstallationDirectory. Within this server configuration file, you must set the APP_DB environment variable to a Java Database Connectivity (JDBC) connection string that contains the appropriate connection parameters for the database that you want to use. An example of setting the environment variable to a JDBC connection string is shown below:

cdata.app.db=jdbc:mysql:Server=MySQLServer;Port=3306;Database=mysql;User=User;Password=Password;UseConnectionPooling=true;

If Sync can establish a connection successfully with the cdata.app.db connection string, it uses that database as the application database.

External Java Server

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

  • Define a Java Naming and Directory Interface (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 JNDI data source or APP_DB connection string to connect to a database, it uses that database as the application database.