Cluster Installation and Configuration
Version 24.3.9120
Version 24.3.9120
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.
Note: Sync evenly distributes scheduled jobs. Your jobs are run either through the Admin console or the REST API, depending on which instance of Sync you are connected to at the time.
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:
-
Set the application directory.
-
Set the application database.
-
Set the Enable Cluster mode option to True in Sync (Settings > Advanced).
-
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:
-
Set up your application directory as follows, dependent on which server you use.
Cross-Platform Edition with the Embedded Jetty Server:
-
Open the sync.properties file that resides in
InstallationDirectory
. For details about how to generate this file, see Generating the sync.properties File. -
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.
-
-
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:
-
Set up your application database as follows, dependent on which server you use.
Cross-Platform Edition with the Embedded Jetty Server:
-
Open the sync.properties file that resides in
InstallationDirectory
. For details about how to generate this file, see Generating the sync.properties File. -
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 the following examples:MySQL
cdata.app.db=jdbc:cdata:mysql:server=localhost;port=3306;database=mysql;user=MyUserName;password=MyPassword;useconnectionpooling=true
PostgreSQL
cdata.app.db=jdbc:cdata:postgresql:server=localhost;port=5432;database=postgresql;user=MyUserName;password=MyPassword;useconnectionpooling=true
SQL Server
cdata.app.db=jdbc:cdata:sql:server=localhost;database=sqlserver;user=MyUserName;password=MyPassword;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. -
-
Configure each Sync installation to use the same application database.