02.10.2015 Views

Tungsten Replicator 2.2 Manual

Tungsten Replicator 2.2 Manual - VMware

Tungsten Replicator 2.2 Manual - VMware

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Command-line Tools<br />

To put the replicator online use the standard form of the command:<br />

shell> trepctl online<br />

Going online may fail if the reason for going offline was due to a fault in processing the THL, or in applying changes to the dataserver. The<br />

replicator will refuse to go online if there is a fault, but certain failures can be explicitly bypassed.<br />

6.9.3.11.1. Going Online from Specific Transaction Points<br />

If there is one, or more, event in the THL that could not be applied to the slave because of a mismatch in the data (for example, a duplicate<br />

key), the event or events can be skipped using the -skip-seqno option. For example, the status shows that a statement failed:<br />

shell> trepctl status<br />

...<br />

pendingError : Event application failed: seqno=5250 fragno=0 »<br />

message=java.sql.SQLException: Statement failed on slave but succeeded on master<br />

...<br />

To skip the single sequence number, 5250, shown:<br />

shell> trepctl online -skip-seqno 5250<br />

The sequence number specification can be specified according to the following rules:<br />

• A single sequence number:<br />

shell> trepctl online -skip-seqno 5250<br />

• A sequence range:<br />

shell> trepctl online -skip-seqno 5250-5260<br />

• A comma-separated list of individual sequence numbers and/or ranges:<br />

shell> trepctl online -skip-seqno 5250,5251,5253-5260<br />

6.9.3.11.2. Going Online from a Base Sequence Number<br />

Alternatively, the base sequence number, the transaction ID where replication should start, can be specified explicitly:<br />

shell> trepctl online -base-seqno 5260<br />

Warning<br />

Use of -base-seqno should be restricted to replicators in the master role only. Use on slaves may lead to duplication<br />

or corruption of data.<br />

6.9.3.11.3. Going Online from a Specific Event<br />

If the source event (for example, the MySQL binlog position) is known, this can be used as the reference point when going online and<br />

restarting replication:<br />

shell> trepctl online -from-event 'mysql-bin.000011:0000000000002552;0'<br />

Because events are not sequential numbers, the replicator will go online at the next nearest event id that corresponds to a transaction.<br />

6.9.3.11.4. Going Online Until Specific Transaction Points<br />

There are times when it is useful to be able to online until a specific point in time or in the replication stream. For example, when<br />

performing a bulk load parallel replication may be enabled, but only a single applier stream is required once the load has finished. The<br />

replicator can be configured to go online for a limited period, defined by transaction IDs, events, heartbeats, or a specific time.<br />

The replicator must be in the offline state before the deferred online specifications are made. Multiple deferred online states can be<br />

specified in the same command when going online.<br />

The setting of a future offline state can be seen by looking at the offlineRequests field when checking the status:<br />

shell> trepctl status<br />

...<br />

minimumStoredSeqNo : 0<br />

offlineRequests : Offline at sequence number: 5262;Offline at time: 2014-01-01 00:00:00 EST<br />

pendingError<br />

: NONE<br />

...<br />

224

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!