Configuring replication using shell scripts
You can configure Q Replication and create replication sets. These replication sets are a collection of table subscriptions, that store metadata regarding which tables to replicate from source site to target site.
Procedure
- From the source site's infra Node/Bastion server, login inside Q Replication pod, to add
a target site:
namespace=<names of your namespace> ; db2uinstName= <name of your Db2 instance> ; kubectl exec -it -n $namespace $(kubectl -n $namespace get po | grep $db2uinstName |grep qrep | awk '{print $1}' ) bash ; Once inside QRep container, switch user to dsadm su - dsadm ; cd $BLUDR_HOME/scripts/bin ;
- Check if there are any existing target sites already added to the source site. Run the
bludr-perform-target-actions.sh
script and select option 1. - To communicate securely using Secure Socket Layer (SSL) the bludr REST API server, Q
Replication IBM Message Queue Capture/Apply, and Db2 server must
exchange SSL certificates. To perform this action, run the
bludr-perform-target-actions.sh
script and select option 2. - Add the destination site to your source site. Run the
bludr-perform-target-actions.sh
script and select option 3.Note: To add the destination site, following information is required:- Target Infra/Bastion hostname
- Target REST external Port
- Target database hostname
- Target external database SSL Port
- Target database name
- Target database replication user
- Target database replication password
- Target data replication environment
When selecting the target data replication, you have the following options:
- IIAS for Sailfish/IIAS Environment.
- DB2WH for Db2 Warehouse private Environment
- DB2WOC for Db2 Warehouse on Cloud Generation 2
- DB2U-DB2OLTP for Cloud Pak for Data Db2 Universal Db2 Online Transaction Processing
- DB2U-DB2WH for Cloud Pak for Data Db2 Universal Db2 Warehouse
- DB2U-SA-DB2OLTP for Standalone Db2 Universal Db2 Online Transaction Processing
- DB2U-SA-DB2WH for Standalone Db2 Universal Db2 Warehouse
- List the current replication sets added to the source site. Run the
bludr-perform-replication-set-actions.sh
script and select option 1. - Create a new empty replication set on your source site. Run the
bludr-perform-replication-set-actions.sh
script and select option 5.Note: To create a new replication set , following information is required:- Target database hostname
- Target external database SSL Port
- Add tables to your replication set:
- Create an input file with table information:
cd $HOME cat > input_schema_table_filename.txt <SCHEMA_NAME1>.<TABLE_NAME1> <SCHEMA_NAME2>.<TABLE_NAME2>
- Run the
bludr-add-tables-to-replset.sh
script and enter the complete file path for the input file. For example:/mnt/qrepdata/home/dsadm/input_schema_table_filename.txt
Note: When running this step, the interactive prompts the following option:Do you want to load all tables added to replication? (y/n)
- Option 'y' indicates that you want Q Replication to perform the initial load of tables from source site to target site.
- Option 'n' indicates that you want to automatically start replication for all the tables.
- Create an input file with table information: