Table of Contents Previous Next


6 Multi-Master Replication Operation : 6.1 Prerequisite Steps

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.
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 xDB Replication Server metadata database objects to users who are to perform inserts, updates, or deletions on the publication tables.
See Step 7 of Section 5.1.3.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.
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 in the following locations:
The modifications needed to the pg_hba.conf file for each of the aforementioned cases are discussed in the following sections.
host control_dbname control_dbuser pub_ipaddr/32 md5
The values you substitute for control_dbname and control_dbuser are the entries for fields database and user in the xDB Replication Configuration file found on the host running the publication server.
The value you substitute for pub_ipaddr is the network IP address where the publication server is running.
Note: The network IP address you substitute for pub_ipaddr must not be the loopback address 127.0.0.1. However, the publication server does require access to the xDB Control database using the loopback address as well. This access is already granted in the default pg_hba.conf file by the following entry:
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.2 or Step 1 of Section 6.1.3.
For a database named edb, the resulting pg_hba.conf file appears as follows:
In the preceding example, the xDB Control database xdb and a master node database edb are running on the same database server.
For a master node using database name mmrnode with database user name mmruser running on a separate host than where the xDB Control database is running, the pg_hba.conf file on this database server would look like the following:

6 Multi-Master Replication Operation : 6.1 Prerequisite Steps

Table of Contents Previous Next