6.1.3.5. Creating the Slave Replicator

The MySQL slave applier is a simple applier that writes the data from the Oracle replicator into MySQL. The replicator can be installed using tpm. The base configuration can be achieved with just a few options, but for convenience, additional filters are employed to change the case of the schema (Oracle schemas are normally in uppercase, MySQL in lowercase), and to rename the Tungsten specific tables so that they match the required service name. For example, within Oracle, the Tungsten tables are stored within the pub user tablespace (i.e. SALES_PUB for the SALES user), but in a MySQL deployment these tables are stored within a database named after the service (i.e. tungsten_alpha).

  1. Unpack the Tungsten Replicator distribution in staging directory:

    shell> tar zxf tungsten-replicator-5.0.tar.gz
  2. Change into the staging directory:

    shell> cd tungsten-replicator-5.0
  3. Obtain a copy of the Oracle JDBC driver and copy it into the tungsten-replicator/lib directory:

    shell> cp ojdbc6.jar ./tungsten-replicator/lib/
  4. These requirements lead to a tpm configuration as follows:

    shell> ./tools/tpm install alpha \
    --install-directory=/opt/continuent \
    --master=host1 \
    --members=host2 \
    --datasource-password=password \ 
    --datasource-user=tungsten \
    --svc-applier-filters=CDC,dbtransform,optimizeupdates \
    --property=replicator.filter.CDC.from=SALES_PUB.HEARTBEAT \
    --property=replicator.filter.CDC.to=tungsten_alpha.heartbeat \
    --property=replicator.filter.dbtransform.from_regex1=DEMO \
    --property=replicator.filter.dbtransform.to_regex1=demo \
    --skip-validation-check=InstallerMasterSlaveCheck \
    --start-and-report

    Once the service has started, the status can be checked and monitored by using the trepctl command.

    The description of each of the options is shown below; click the icon to hide this detail:

    Click the icon to show a detailed description of each argument.

If the installation process fails, check the output of the /tmp/tungsten-configure.log file for more information about the root cause.

Once installed, check the replicator status using trepctl status:

shell> trepctl status
Processing status command...
NAME                     VALUE
----                     -----
appliedLastEventId     : ora:16626156
appliedLastSeqno       : 67
appliedLatency         : 314.359
channels               : 1
clusterName            : alpha
currentEventId         : NONE
currentTimeMillis      : 1410431215649
dataServerHost         : tr-fromoracle2
extensions             : 
host                   : tr-fromoracle2
latestEpochNumber      : 67
masterConnectUri       : thl://tr-fromoracle1:2112/
masterListenUri        : thl://tr-fromoracle2:2112/
maximumStoredSeqNo     : 67
minimumStoredSeqNo     : 67
offlineRequests        : NONE
pendingError           : NONE
pendingErrorCode       : NONE
pendingErrorEventId    : NONE
pendingErrorSeqno      : -1
pendingExceptionMessage: NONE
pipelineSource         : thl://tr-fromoracle1:2112/
relativeLatency        : 316.649
resourcePrecedence     : 99
rmiPort                : 10000
role                   : slave
seqnoType              : java.lang.Long
serviceName            : alpha
serviceType            : local
simpleServiceName      : alpha
siteName               : default
sourceId               : tr-fromoracle2
state                  : ONLINE
timeInStateSeconds     : 2.343
transitioningTo        : 
uptimeSeconds          : 74327.712
useSSLConnection       : false
version                : Tungsten Replicator 5.0.0 build 0
Finished status command...