Cluster Installation and Configuration

Version 23.4.8843


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, you should install the application 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.

The overall steps to set clustering are as follows:

  1. Set the application directory.

  2. Set the application database.

  3. Set the Enable Cluster mode option to True in Sync (Settings > Advanced).

  4. Restart Sync.

Configuring CData Sync for Clustering

After you install Sync on each node within a cluster, you need to configure your application directory and application database. Then, you need to configure each installation to use the same application directory and application database.

Configuring the Application Directory

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

To configure the application directory:

  1. Set up your application directory, as follows, according to which edition of Sync and server that you are using.

    Windows Edition:

    Set the AppDirectory environment variable to the path where the directory should be created, as follows:

    1. Locate the <AppDirectory> XML element in the Web.Config file, which resides in the www folder of the installation directory (InstallationDirectory). The <AppDirectory> element is surrounded by delimiters to comment out that element.

    2. Locate the <appSettings> element, which appears below the <AppDirectory> element. The <appSettings> element is also commented out.

    3. Remove the comment delimiters from <appSettings> element. Then, set the <AppDirectory> key value to the appropriate path on the disk for your custom directory location, as shown in this example:

       <appSettings>
          <add key="AppDirectory" value="C:\\DirectoryName\\SubdirectoryName\\SubdirectoryName" />
       </appSettings>
      

      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.

    Cross-Platform Edition with the Embedded Jetty Server:

    1. Open the cdata.properties file that resides in InstallationDirectory.

    2. Set the AppDirectory environment variable to the directory path that you want to use, as shown in this example:

        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.

    Cross-Platform Edition with an External Server:

    When you use the Cross-Platform Edition with an external servlet, the configuration of the application directory depends on 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 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.

  2. Configure each Sync installation to use the same application directory.

Configuring the 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 ensures that each instance can access all the job information.

To configure the application data directory:

  1. Set up your application database, as follows, dependent on which edition of Sync and server that you are using:

    Windows Edition:

    Set the AppDB environment variable to include the appropriate connection string and provider, as follows:

    1. Locate the <connectionStrings> XML element in the Web.Config file, which resides in the www folder of the installation directory (InstallationDirectory). The <connectionStrings> element is surrounded by comment delimiters to comment out that element.

    2. Locate the <appSettings> element, which appears below <AppDirectory>. The <appSettings> element is also commented out.

    3. Remove the comment delimiters from the <connectionStrings> element. Then, set the connectionString and providerName attributes to the appropriate connection parameters for the database that you want to use, as shown in this example:

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

      Note: Sync supports the following providers: System.Data.SqlClient, System.Data.CData.MySQL, and System.Data.CData.PostgreSQL

      If Sync can establish a connection successfully with this connection string, it uses this database as the application database.

    Cross-Platform Edition with the Embedded Jetty Server:

    1. Open the sync.properties file that resides in InstallationDirectory.

    2. 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, as shown in this example:

      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.

    Cross-Platform Edition with an External Server:

    When you use the Cross-Platform Edition with an external servlet, the configuration of the application database depends on the specific servlet that you use. 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) data source 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 the APP_DB connection string to connect to a database, it uses that database as the application database.

  2. Configure each Sync installation to use the same application database.