Install Multiple Replicators
For example, to create two services, one that reads from MySQL and another that writes to MongoDB on the same host:
Install the Tungsten Replicator package or download the Tungsten Replicator tarball, and unpack it:
shell> cd /opt/continuent/softwareshell> tar zxf tungsten-replicator-8.0.4-132.tar.gzCreate the proper directories with appropriate ownership and permissions:
shell> sudo mkdir /opt/applier /opt/extractorshell> sudo chown tungsten: /opt/applier/ /opt/extractor/shell> sudo chmod 700 /opt/applier/ /opt/extractor/Change to the Tungsten Replicator directory:
shell> cd tungsten-replicator-8.0.4-132Using the below example, create the
/etc/tungsten/extractor.inito configure the extractor reading from MySQL:Example extractor.ini[defaults]install-directory=/opt/extractoruser=tungstenprofile-script=~/.bash_profilemysql-allow-intensive-checks=truedisable-security-controls=trueexecutable-prefix=extrest-api-admin-user=apiuserrest-api-admin-password=secretreplicator-rest-api-address=0.0.0.0[alpha]master=offboardhostmembers=offboardhostenable-heterogeneous-service=truereplication-port=3306replication-user=tungsten_alphareplication-password=secretdatasource-mysql-conf=/etc/my.cnfsvc-extractor-filters=colnames,pkeyproperty=replicator.filter.pkey.addColumnsToDeletes=trueproperty=replicator.filter.pkey.addPkeyToInserts=truemysql-enable-enumtostring=truemysql-enable-settostring=truemysql-use-bytes-for-string=falseShow argument definitions
install-directory=/opt/extractorInstallation directory.user=tungstenOS System User, for example tungsten. DO NOT use root.profile-script=~/.bash_profileAppend commands to include env.sh in this profile script.mysql-allow-intensive-checks=trueFor MySQL installation, enables detailed checks on the supported data types within the MySQL database to confirm compatibility.disable-security-controls=trueDisables all forms of security, including SSL, TLS and authentication.executable-prefix=extAdds a prefix to command aliases.rest-api-admin-user=apiuserSpecify the initial Admin Username for API access.Available from v7.0.0rest-api-admin-password=secretSpecify the initial Admin User Password for API access.rest-api-admin-passwordalias only available from version 7.1.2 onwards.Available from v7.0.0replicator-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0This is a standard configuration using the default ports, with the directory
/opt/extractor.Using the below example, create the
/etc/tungsten/applier.inito configure the applier for writing to MongoDB:Example applier.ini[defaults]install-directory=/opt/applierprofile-script=~/.bash_profileskip-validation-check=InstallerMasterSlaveCheckexecutable-prefix=apprest-api-admin-user=apiuserrest-api-admin-password=secretreplicator-rest-api-address=0.0.0.0[alpha]master=localhostmembers=localhostrole=slavedatasource-type=mongodbreplication-user=tungstenreplication-password=secretrmi-port=10002master-thl-port=2112master-thl-host=localhostthl-port=2113Show argument definitions
install-directory=/opt/applierInstallation directory.profile-script=~/.bash_profileAppend commands to include env.sh in this profile script.skip-validation-check=InstallerMasterSlaveCheckDo not run the specified validation check.executable-prefix=appAdds a prefix to command aliases.rest-api-admin-user=apiuserSpecify the initial Admin Username for API access.Available from v7.0.0rest-api-admin-password=secretSpecify the initial Admin User Password for API access.rest-api-admin-passwordalias only available from version 7.1.2 onwards.Available from v7.0.0replicator-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0In this configuration, the Extractor THL port is specified explicitly, along with the THL port used by this replicator, the RMI port used for administration, and the installation directory
/opt/applier.Run
tpmto install the software, once for each configuration file:shell> ./tools/tpm install --ini /etc/tungsten/extractor.inishell> ./tools/tpm install --ini /etc/tungsten/applier.iniDuring the startup and installation,
tpmwill notify you of any problems that need to be fixed before the service can be correctly installed and started. Ifstart-and-reportis set and the service starts correctly, you should see the configuration and current status of the service.Initialize your
PATHand environment.shell> source /opt/extractor/share/env.shshell> source /opt/applier/share/env.shYou can now start and check the replication status, using the values of
executable-prefixin front of the standard CLI tools to control the specific extractor or applier service
When multiple replicators have been installed, checking the replicator status through trepctl depends on the replicator executable location
used. If /opt/extractor/tungsten/tungsten-replicator/bin/trepctl, the extractor service status will be reported.
If /opt/applier/tungsten/tungsten-replicator/bin/trepctl is used, then the applier service status will be reported.
To make things easier, in the config examples above executable-prefix has been used, which will set up OS aliases. These aliases are setup when
you source the relevant env.sh files, this will also happen by default when you login to the host providing profile-script has been
specified.
The use of the prefix and aliases, then simplifies the use of all executables, for example, based on the setting of executable-prefix in the
above config examples, to report the status of the extractor, you can execute:
shell> ext_trepctl status
Or to check the applier service:
shell> app_trepctl status
Alternatively, a specific replicator can be checked by explicitly specifying the RMI port of the service. For example, to check the extractor service:
shell> trepctl -port 10000 status
Or to check the applier service:
shell> 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.
Further, either path may be used to get a summary view using multi_trepctl command:
shell> /opt/extractor/tungsten/tungsten-replicator/scripts/multi_trepctl
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| host1 | extractor | master | ONLINE | 0 | 1.724 |
| host1 | applier | slave | ONLINE | 0 | 0.000 |