It is possible to install multiple replicators on the same host. This can be useful, either when building complex topologies with multiple services, and in hetereogenous environments where you are reading from one database and writing to another that may be installed on the same single server.
When installing multiple replicator services on the same host, different values must be set for the following configuration parameters:
RMI network port used for communicating with the replicator service.
Set through the
to tpm. Note that RMI ports are configured in
pairs; the default port is 10000, port 10001 is used automatically.
When specifying an alternative port, the subsequent port must also be
available. For example, specifying port 10002 also requires 10003.
THL network port used for exchanging THL data.
Master THL port, i.e. the port from which a slave will read THL events from the master
Installation directory used when the replicator is installed.
Set through the
--install-directory parameters to
tpm. This directory must have been created, and be
configured with suitable permissions before installation starts. For
more information, see Section C.3.3, “Directory Locations and Configuration”.
For example, to create two services, one that reads from MySQL and another that writes to MongoDB on the same host:
Extract the Tungsten Replicator software into a single directory.
Extractor reading from MySQL:
./tools/tpm configure extractor \ --install-directory=/opt/extractor \ --master=host1 \ --members=host1 \ --replication-password=password \ --replication-user=tungsten \ --start=true
This is a standard configuration using the default ports, with the
Reset the configuration:
tpm configure defaults --reset
Applier for writing to MongoDB:
./tools/tpm configure applier \ --datasource-type=mongodb \ --install-directory=/opt/applier \ --master=host1 \ --members=host1 \ --start=true \ --topology=master-slave \ --rmi-port=10002 \ --master-thl-port=2112 \ --master-thl-host=host1 \ --thl-port=2113
In this configuration, the master THL port is specified explicitly,
along with the THL port used by this replicator, the RMI port used for
administration, and the installation directory
When multiple replicators have been installed, checking the replicator
status through trepctl depends on the replicator
executable location used. If
the extractor service status will be reported. If
is used, then the applier service status will be reported.
Alternatively, a specific replicator can be checked by explicitly specifying the RMI port of the service. For example, to check the extractor service:
trepctl -port 10000 status
Or to check the applier service:
trepctl -port 10002 status
When an explicit port has been specified in this way, the executable used is irrelevant. Any valid trepctl instance will work.