Postgres Plus xDB Replication Server with Multi-Master User's Guide : 6.2 Creating a Publication

Previous PageTable Of ContentsNext Page

Postgres Plus Advanced Server xDB Replication Server User's Guide

 

6.2 Creating a Publication

Creating a publication requires the following steps:

    ● Registering the publication server

    ● Adding the master definition node

    ● Creating a publication by choosing the tables for the publication along with the conflict resolution options

6.2.1 Registering a Publication Server

Registering a publication server is done in a manner identical to single-master replication. See Section 5.2.1 for directions on registering a publication server.

Figure 111 - Replication tree after registering a publication server

After you have successfully registered a publication server, the replication tree of the xDB Replication Console displays a Publication Server node under which are the SMR and MMR type nodes.

Continue to build the multi-master replication system under the MMR type node.

6.2.2 Adding the Master Definition Node

The first database to be identified to xDB Replication Server is the master definition node. This is done by creating a publication database definition subordinate to the MMR type node under the Publication Server node.

After the publication database definition is created, a Publication Database node representing the master definition node appears in the replication tree of the xDB Replication Console. A publication containing tables residing within this database can then be created under the Publication Database node.

You must enter database connection information such as the database server network address, database identifier, and database login user name and password when you create the publication database definition. The connection information is used by the publication server to access the publication tables when it performs replication.

Step 1: Make sure the database server for the master definition node is running and accepting client connections.

Step 2: Select the MMR type node under the Publication Server node. From the Publication menu, choose Publication Database, and then choose Add Database. Alternatively, click the secondary mouse button on the MMR type node and choose Add Database. The Publication Service – Add Database dialog box appears.

Step 3: Fill in the following fields:

    Database Type. Select PostgreSQL or Postgres Plus Advanced Server for the master definition node. For an Advanced Server Oracle compatible installation, select the Postgres Plus Advanced Server option. For PostgreSQL or an Advanced Server PostgreSQL compatible installation, select the PostgreSQL option.

    Host. IP address of the host on which the master definition node is running.

    Port. Port on which the master definition node is listening for connections.

    User. The database user name for the master definition node created in Step 1 of Section 6.1.1.

    Password. Password of the database user.

    Database. Enter the database name of the master definition node.

    Node Priority Level. An integer from 1 to 10, which is the priority level assigned to this master node for conflict resolution based on node priority. The highest priority is 1 while the lowest is 10. See Section 6.6.3 for information on conflict resolution strategies. The default is 1 for the master definition node.

Figure 112 - Publication Service - Add Database dialog box for the master definition node

Step 4: Click the Test button. If Test Result: Success appears, click the OK button, then click the Save button.

Figure 113 - Successful master definition node test

If an error message appears investigate the cause of the error, correct the problem, and repeat steps 1 through 4.

When the publication database definition is successfully saved, a Publication Database node is added to the replication tree under the MMR type node of the Publication Server node.

Figure 114 - Replication tree after adding the master definition node

The label MDN appears at the end of the node in the replication tree and in addition, the MDN field is set to Yes in the Property window to indicate this is the master definition node.

6.2.3 Adding a Publication

Subordinate to the master definition node, you create a publication that contains tables of the database.

Step 1: Select the Publication Database node. From the Publication menu, choose Create Publication. Alternatively, click the secondary mouse button on the Publication Database node and choose Create Publication. The Create Publication dialog box appears.

Step 2: Fill in the following fields under the Create Publication tab:

    Publication Name. Enter a name that is unique amongst all publications.

    Publish. Check the boxes next to the tables that are to be included in the publication.

    Select All. Check this box if you want to include all tables in the Available Tables list in the publication.

Figure 115 - Create Publication dialog box

If you wish to change the conflict resolution options from their default settings, follow the directions in the next step, otherwise go on to Step 4.

Step 3 (Optional): If you want to modify or see the current conflict resolution options, click the Conflict Resolution Options tab. For each table, you can select the primary conflict resolution strategy and a standby strategy by clicking the primary mouse button over the appropriate box to expose a drop-down list of choices.

Figure 116 - Conflict Resolution Options tab

If during synchronization replication, conflicting changes are pending against the same row from different master nodes, the conflict resolution strategy determines which of the conflicting changes is accepted and replicated to all master nodes. The conflicting changes that are not accepted are discarded.

If the selection from the Conflict Resolution Strategy column does not resolve the conflict, the selection from the Standby Conflict Resolution Strategy column is applied. If neither strategy resolves the conflict, the event is marked as Pending in the Conflict History tab. See Section 6.7 for information on viewing conflict history.

An example of a conflict is when the same column of the same row is changed by transactions in two different master nodes. Depending upon the conflict resolution strategy in effect for the table, one of the transactions is accepted and replicated to all master nodes. The other transaction is discarded and not replicated to any master node.

The following is a brief summary of each conflict resolution strategy:

    Earliest Timestamp. The conflicting change with the earliest timestamp is accepted and replicated to all other master nodes. All other conflicting changes are discarded.

    Latest Timestamp. The conflicting change with the latest timestamp is accepted and replicated to all other master nodes. All other conflicting changes are discarded.

    Node Priority. The conflicting change occurring on the master node with the highest priority level is accepted and replicated to all other master nodes. All other conflicting changes are discarded.

    Manual. The conflict remains unresolved. Conflicting changes remain applied in each master node where they originated, but are not replicated to other master nodes. The proper adjustments must be manually applied in each master node.

See Section 6.6.3 for more information on conflict resolution strategies.

Step 4: Click the Create button. If Publication Created Successfully appears, click the OK button, otherwise investigate the error and make the necessary corrections.

Figure 117 - Publication created successfully

Upon successful publication creation, a Publication node is added to the replication tree.

Figure 118 - Replication tree after adding a publication

Previous PageTable Of ContentsNext Page