Replication Example

Replication Example

Top  Previous  Next

 

This example gives a step by step guide to setting up a simple replication system. It is based on the simple sales processing database created by the SETUP.DEMO command, creating a reporting server that mirrors the data from the STORE account on the live production system. Pathnames below are as appropriate for a Linux system but can be substituted with Windows pathnames.

 

Replication

The Reporting Server - Part 1

 

1. The reporting server should be set up with a copy of the STORE account from the live server, typically by restoring a backup.

 

2. Use EDIT.CONFIG or a text editor to set the NETFILES configuration parameter to allow incoming QMNet connections and set REPLSRVR to the name that will be used by the live server to reference the reporting server.

NETFILES=2

REPLSRVR=REPORTING

 

3. Restart QM.

 

 

The Live Server

 

1. Log to the QMSYS account

LOGTO QMSYS

 

2. Add a QMNet server definition that allows access to the reporting server using the server name set in the REPLSRVR parameter above.

SET.SERVER REPORTING

Enter appropriate network and user authentication details.

 

3. Use EDIT.CONFIG or a text editor to add the REPLDIR configuration parameter that identifies where replication log files will be stored.

REPLDIR=/usr/replication

 

4. Restart QM.

 

5. Log to the account holding the files to be published.

LOGTO STORE

 

6. Publish the data files that are to be replicated

PUBLISH STOCK REPORTING:STORE:STOCK

PUBLISH SALES REPORTING:STORE:SALES

PUBLISH CUSTOMERS REPORTING:STORE:CUSTOMERS

If many files are to be published, use of the PUBLISH.ACCOUNT command will be simpler.

 

7. If the files to be published may have changed on the live server since the copy was created on the reporting server, copy the current versions of these files across.

 

8. Ensure that the port to be used by replication (set by REPLPORT parameter on the reporting server, default 4244) is open in any firewall.

 

 

The Reporting Server - Part 2

 

1. Determine the user name to be used for the subscriber phantom process. This user must have full access to all files that are being updated by the replication process.

 

2. Ensure that any subroutines called from I-type dictionary items used by alternate key indices on replicated files are either globally catalogued or catalogued within the QMSYS account.

 

3. Use the AUTHKEY command in the QMSYS account to form the encrypted password for this user.

AUTHKEY password

 

4. Use EDIT.CONFIG or a text editor to add a STARTUP configuration parameter that will start the subscriber phantom automatically whenever QM is started.

STARTUP=SUBSCRIBE 123.123.123.123 username ENCR:password

where 123.123.123.123 is the network address or name of the live server, username is the user name for the subscriber phantom and password is the encrypted password.

 

5. Either restart QM or start the subscriber phantom manually using the command from the STARTUP configuration parameter above.

 

All updates to published files on the live system should now be applied automatically to the same files on the reporting server.