Setting Up Replication Environment Options

<< DeploymentOptions - TOC - Administering And Monitoring Replication >>
This chapter discusses the various operational restrictions, capacity requirements, and system changes you need to make based on the Replication system you select.

Operational Restrictions

Replication imposes the following operational Restrictions:

  • Replication is supported between CSQL instances
  • A CSQL server instance can participate in only one quorum.

SQL Statement Use

Once you have defined a table to Replication, you cannot execute any operation that changes the table and its schema definitions. You cannot use below SQL statement against the table.

  • DROP TABLE

The following additional restrictions also apply to tables defined for replication:

  • Do not remove the primary key constraint.
  • Do not add, or drop columns.
  • Do not modify the primary key column.

The following SQL statements are permitted:

  • ADD INDEX
  • DROP INDEX

Configuration Parameter

The database server configuration file (csql.conf) under CSQL root directory includes eleven configuration parameters that affect the behavior of Replication.

  • SITE_ID
  • CSQL_SQL_SERVER
  • PORT
  • REPLICATION
  • REPLICATION_SITES
  • NETWORK_CONFIG_FILE
  • CONFL_RESOL_FILE
  • MSG_KEY
  • ID_SHM_KEY
  • ASYNC_MSGMAX
  • MAX_QUEUE_LOGS

The above parameters could be divides in two parts one for Replication and another for Network.

Replication Configuration parameters:

  • SITE_ID
  • REPLICATION
  • REPLICATION_SITES
  • NETWORK_CONFIG_FILE
  • CONFL_RESOL_FILE
  • MSG_KEY
  • ID_SHM_KEY
  • ASYNC_MSGMAX
  • MAX_QUEUE_LOGS

Network Configuration Parameters:

  • CSQL_SQL_SERVER
  • PORT

CSQL requires some system parameters that need to be set before starting CSQL server. These configuration variables are defined in a file called csql.conf. Some of the parameters mentioned in this file may have to be tweaked based on the requirements. The lines starting with # are ignored as comments and the rest are treated as configuration variables. These variable values are read from this file during server start up. These configuration variables are divided logically into following classes.

  • Server section variables
  • Client section variables
  • Cache section variables
  • Replication section variables

It is very important to note that for Server section parameters, the value should be the same for the server process and all the CSQL client processes, which connects to it. Otherwise, behavior is undefined. For Server and Client section variables and additional information about configuration parameters refer to the, Section 3.5.2.2 in CSQL User’s Manual.

Setting up parameters in csql.conf file

The configuration file, csql.conf has eleven parameters that need to be set up for replication. Some of the parameters are present in Cache Section and most are present in SQL Network Server Section in csql.conf file.

  • Set the REPLICATION parameter to true to enable replication

[ REPLICATION = true ]

This is a Boolean parameter and should be set to true to enable replication across site.

  • Set the SITE_ID parameter respect to the database server

[ SITE_ID=1 ]

This is an integer parameter and it identifies a CSQL instance in a quorum. Set this to a unique value for all the nodes in the quroum. In example, this parameter will be set to 1 for CSQL Instance-1 and will be set to 2 for CSQL Instance-2 and so on.

  • Set the CSQL_SQL_SERVER configuration parameter to true

[ CACHE_SQL_SERVER=true ]

This is a Boolean parameter and should be set to true when replication is turned on.

  • Set the PORT parameter for network access

[ PORT = 5678 ]

This is an integer parameter to set the port for network access, by default it is set to the number 5678.

  • REPLICATION_SITES according to the sites go long

[ REPLICATION_SITES = 16 ]

This is an integer parameter to specify the maximum no of sites present in the quorum. Default value is 16.

  • NETWORK_CONFIG_FILE parameter to ‘/tmp/csql/csqlnw.conf’

[ NETWORK_CONFIG_FILE=/tmp/csql/csqlnw.conf ]

This is a string parameter, which contains the complete path to the file, which holds the complete information about the peer site information in the quorum.

  • CONFL_RESO_FILE parameter

[ CONFL_RESO_FILE=/tmp/csql/conflResoFile.txt ]

This is a string parameter, which contains the complete path to the file and also holds the complete information about the transactional conflicts that have been generated because of execution failures at the destination site in case of asynchronous updates.

  • MSG_KEY and ID_SHM_KEY configuration parameter

[ MSG_KEY = 2525 ] [ ID_SHM_KEY = 1947 ]

These are integer parameters and are used for creating message queue for MsgQueue server. It is used when your replication mode is Async only. This is an internal parameter and user need not modify this value.

  • ASYNC_MSGMAX parameter

[ ASYNC_MSGMAX = 8192 ]

This parameter should be set when asynchronous cache updates or asynchronous replication feature is required. By default this parameter is 8192 bytes(8kb). This corresponds to kernel parameter of message queue ‘kernel.msgmax’, which is the maximum size of a message in a message queue. By default Linux has 8192 bytes for this parameter and it is suggested to verify for the same in the user environment. Privileged user can modify this parameter using sysctl tool as follows

\#/sbin/sysctl –w kernel.msgmax=<SIZE_TO_SET>

  • MAX_QUEUE_LOGS Parameter

[ MAX_QUEUE_LOGS = 100 ]

This parameter is set for maximum number of messages that CSQL Message Queue hold it internally incase of peer site goes down. If this queue gets full, then all updates for down site are removed from the queue and it is expected to re subscribe all the replicated tables when it comes back. After setting up the environment variables we can set our sites to replicate data from one site to another.

<< DeploymentOptions - TOC - Administering And Monitoring Replication >>

Page last modified on October 13, 2009, at 11:03 AM