6.1 Prerequisite Steps

Table of Contents Previous Next


6 Multi-Master Replication Operation : 6.1 Prerequisite Steps

wal_level. Set to logical.
max_wal_senders. Specifies the maximum number of concurrent connections (that is, the maximum number of simultaneously running WAL sender processes). Set at minimum, to the number of MMR master nodes on this database server that will use the log-based method. In addition, if SMR publication databases are to run on this database server, also add the number of SMR publication databases that will use the log-based method.
max_replication_slots. Specifies the maximum number of replication slots. For support of MMR systems, the minimum is the total number of master nodes in the multi-master replication system multiplied by the number of master nodes residing on this database server. For information, see Section 2.2.10.4. In addition, if SMR publication databases are to run on this database server, also add the number of SMR publication databases that will use the log-based method.
track_commit_timestamp. Set to on. This configuration parameter applies only to Postgres database servers of version 9.5. See Section 6.6.1 for additional information.
See Section 2.2.10 for information on the log-based method of synchronization replication.
In addition, the pg_hba.conf file requires an entry for each publication database user of master nodes that are to use the log-based method. Such database users must be included as a replication database user in the pg_hba.conf file. See Section 6.1.5 for additional information.
The database user has superuser privileges. Superuser privileges are required because the database configuration parameter session_replication_role is altered by the database user when the master definition node receives updates from other master nodes during a synchronization replication. The database user temporarily changes session_replication_role to replica to prevent the triggers on the publication tables from firing. This session change also occurs for snapshot operations involving replication of the control schema from one publication database to another.
Three tables named dept, emp, and jobhist are members of schema edb.
Step 1: Create a user name with login and superuser privileges for the master definition node. This user becomes the owner of xDB Replication Server metadata database objects that will be created in the master definition node to track, control, and record the replication process and history. The xDB Replication Server metadata database objects are created in a schema named _edb_replicator_pub.
Step 2 (Optional): If users are to access the data in the publication tables residing on this master node, it is convenient to have one or more “group” roles containing the required privileges to access these tables. Privileges must also be granted on the control schema objects to users who are to perform inserts, updates, or deletions on the publication tables.
See Step 2 of Section 5.1.4.3 for information on creating such roles.
The database user has superuser privileges. Superuser privileges are required because the database configuration parameter session_replication_role is altered by the database user when the master node receives updates from other master nodes during a synchronization replication. The database user temporarily changes session_replication_role to replica to prevent the triggers on the publication tables from firing. This session change also occurs for snapshot operations involving replication of the control schema from one publication database to another.
Step 1: Create a database user name for the master node. This user becomes the owner of xDB Replication Server metadata database objects that will be created in the master node to track, control, and record the replication process and history. The xDB Replication Server metadata database objects are created in a schema named _edb_replicator_pub.
Step 2: Create a database that will be used as the master node if such a database does not already exist.
A Postgres database server uses the host-based authentication file, pg_hba.conf, to control access to the databases in the database server.
You need to modify the pg_hba.conf file on each Postgres database server that contains a master node.
The modification needed to the pg_hba.conf file is discussed in the following section.
host masternode_db masternode_user pub_ipaddr/32 md5
The value you substitute for masternode_db is the name of the database you intend to use as the master node. The value you substitute for masternode_user is the database user name you created in Step 1 of Section 6.1.3 or Step 1 of Section 6.1.4.
For two master nodes using databases named edb and mmrnode running on the same database server, the resulting pg_hba.conf file appears as follows:
If the master node using database mmrnode with database user name mmruser is running on a separate host than where database edb is running, the pg_hba.conf file on the database server with database mmrnode would look like the following:
The preceding examples assume databases edb and mmrnode are using the trigger-based method of synchronization replication. If the log-based method is used, the pg_hba.conf file must contain additional entries with the DATABASE field set to replication for masternode_user and pub_ipaddr to allow replication connections from the publication server on the host on which it is running.
See sections 2.2.10 and 6.1.2 for additional information on synchronization replication with the log-based method.

6 Multi-Master Replication Operation : 6.1 Prerequisite Steps

Table of Contents Previous Next