Configuring and running the EDB DMS agent in reader mode v1.3.4

Configure and run the DMS agent in reader mode to perform a data migration.

Prerequisites

  1. Ensure the machine where you're running the DMS agent has Java/OpenJDK 17 or later installed.

  2. Install the EDB DMS agent.

  3. Open the EDB DMS agent located in /opt/cdcagent/run-cdcagent.sh with write permissions.

Configuring the EDB DMS Agent for migrations from Postgres

Set the variables in the script according to your environment and uncomment the edited lines. See parameters for more guidance. The following shows the unedited script:

#!/bin/bash -e
# run_cdcagent.sh
#
# This script provides a convenient place to specify
# environment variables used to configure the
# EDB Data Migration Service Agent.
#

##########################################
# DMS Agent General Configuration       #
##########################################

# This ID is used to identify DMS Agent
# and is specified by the user.
export DBCONFIG_ID=<source_name_of_choice>

# Determine the run mode of the DMS Agent
# The run mode can be set to either 'reader' or 'writer'
# 'reader' mode is used to read changes from a source database
# 'writer' mode is used to write changes to a target database
export RUN_MODE=reader

# This is the DMS backend service used by the Agent
# Consult your system administrators
export RW_SERVICE_HOST=https://${TRANSPORTER_RW_SERVICE_DOMAIN_NAME}/transporter

##########################################
# DMS Agent TLS Configuration           #
##########################################

# You need to create migration credentials in EDB Postgres AI platform
# and set the path of the credentials directory
export CREDENTIAL_DIRECTORY_PATH=$HOME/credentials

##########################################
# DMS Agent DB Configuration     #
##########################################

# A sample configuration to create a single postgres database connection:
export DBCONFIG_DATABASES_0__TYPE=POSTGRES
export DBCONFIG_DATABASES_0__HOSTNAME=<localhost/host>
export DBCONFIG_DATABASES_0__PORT=<5432>
# The CATALOG is the database name
export DBCONFIG_DATABASES_0__CATALOG=<source>
export DBCONFIG_DATABASES_0__USERNAME=<postgres>
# The password env can be set without specifying it here
# but the env structure looks like this
export DBCONFIG_DATABASES_0__PASSWORD=<password>
# The resource_id is configured by the customer in the configuration file of the beacon agent
# need to make sure that the resource_id is set to the same value as in the beacon agent
#export DBCONFIG_DATABASES_0__RESOURCEID=1234567890abcdef

# You can increase the index to configure more than
# one database for the DMS Agent
#export DBCONFIG_DATABASES_1__TYPE=ORACLE
#export DBCONFIG_DATABASES_1__HOSTNAME=localhost
#export DBCONFIG_DATABASES_1__PORT=1521
# The CATALOG is the database name
#export DBCONFIG_DATABASES_1__CATALOG=ORCLCDB/ORCLPDB1
#export DBCONFIG_DATABASES_1__USERNAME=oracle
# The password env can be set without specifying it here
# but the env structure looks like this
#export DBCONFIG_DATABASES_1__PASSWORD=password
# The resource_id is configured by the customer in the configuration file of the beacon agent
# need to make sure that the resource_id is set to the same value as in the beacon agent
#export DBCONFIG_DATABASES_1__RESOURCEID=1234567890abcdef

##########################################
# Optional Parameters Below              #
##########################################

# FIPS mode can be enabled by setting the FIPS_MODE env variable to true
#export FIPS_MODE=true

# Configure logging
# Loglevel for the entire Quarkus application and underlying components
# WARNING: Enabling this loglevel is extremely verbose
#export QUARKUS_LOG_LEVEL=DEBUG
# Loglevel for the EDB package
# Preferred mode for debugging issues related to the logic of the agent
#export QUARKUS_LOG_CATEGORY__COM_ENTERPRISEDB__LEVEL=DEBUG

cd "$(dirname "$0")"

echo "Starting in mode: $RUN_MODE"

case "$RUN_MODE" in
  reader)
    java -jar ./reader/quarkus-run.jar
    ;;
  writer)
    java -jar ./writer/quarkus-run.jar
    ;;
  *)
    echo "Unknown RUN_MODE: $RUN_MODE"
    exit 1
    ;;
esac

Running the EDB DMS agent

Start the migration:

cdcagent