The trepctl online command puts the replicator into
the online state. During the state change from offline to online various
options can be used to control how the replicator goes back on line. For
example, the replicator can be placed online, skipping one or more
faulty transactions or disabling specific configurations.
trepctl online [
-base-seqno x ] [
-force ] [
-from-event event ] [
-no-checksum ] [
-skip-seqno seqdef ] [
-until-event event ] [
-until-heartbeat [name] ] [
-until-seqno seqno ] [
-until-time YYYY-MM-DD_hh:mm:ss ]
The trepctl online command attempts to switch
replicator into the online state. The replicator may need to be put
online because it has been placed offline for maintenance, or due to a
To put the replicator online use the standard form of the command:
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
replicator will refuse to go online if there is a fault, but certain
failures can be explicitly bypassed.
188.8.131.52.1. Going Online from Specific Transaction Points
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 key), the event or events can be skipped using the
-skip-seqno option. For
example, the status shows that a statement failed:
pendingError : Event application failed: seqno=5250 fragno=0 »
message=java.sql.SQLException: Statement failed on slave but succeeded on master
To skip the single sequence number,
trepctl online -skip-seqno 5250
The sequence number specification can be specified according to the
A single sequence number:
trepctl online -skip-seqno 5250
A sequence range:
trepctl online -skip-seqno 5250-5260
A comma-separated list of individual sequence numbers and/or
trepctl online -skip-seqno 5250,5251,5253-5260
184.108.40.206.2. Going Online from a Base Sequence Number
Alternatively, the base sequence number, the transaction ID where
replication should start, can be specified explicitly:
trepctl online -base-seqno 5260
should be restricted to replicators in the
master role only. Use on
slaves may lead to duplication or corruption of data.
220.127.116.11.3. Going Online from a Specific Event
If the source event (for example, the MySQL binlog position) is known,
this can be used as the reference point when going online and
trepctl online -from-event 'mysql-bin.000011:0000000000002552;0'
When used, replication will start from the next event within the THL.
The event ID provided must be valid. The event cannot be found in the
THL, the operation will fail.
18.104.22.168.4. Going Online Until Specific Transaction Points
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
performing a bulk load parallel replication may be enabled, but only a
single applier stream is required once the load has finished. The
replicator can be configured to go online for a limited period,
defined by transaction IDs, events, heartbeats, or a specific time.
The replicator must be in the offline state before the deferred online
specifications are made. Multiple deferred online states can be
specified in the same command when going online.
The setting of a future offline state can be seen by looking at the
offlineRequests field when checking the status:
minimumStoredSeqNo : 0
offlineRequests : Offline at sequence number: 5262;Offline at time: 2014-01-01 00:00:00 EST
pendingError : NONE
If the replicator goes offline for any reason before the deferred
offline state is reached, the deferred settings are lost.
22.214.171.124.4.1. Going Online Until Specified Sequence Number
To go online until a specific transaction ID, use
trepctl online -until-seqno 5260
This will process all transactions up to, and including, sequence
5260, at which point the replicator will go offline.
126.96.36.199.4.2. Going Online Until Specified Event
To go online until a specific event ID:
trepctl online -until-event 'mysql-bin.000011:0000000000003057;0'
Replication will go offline when the event ID up to the specified
event has been processed.
188.8.131.52.4.3. Going Online Until Heartbeat
To go online until a heartbeat event:
trepctl online -until-heartbeat
Heartbeats are inserted into the replication stream periodically,
replication will stop once the heartbeat has been seen before the
next transaction. A specific heartbeat can also be specified:
trepctl online -until-heartbeat load-finished
184.108.40.206.4.4. Going Online Until Specified Time
To go online until a specific date and time:
trepctl online -until-time 2014-01-01_00:00:00
Replication will go offline once the transaction being processed at
the time specified has completed.
220.127.116.11.5. Going Online by Force
In situations where the replicator needs to go online, the online
state can be forced. This changes the replicator state to online, but
provides no guarantees that the online state will remain in place if
another, different, error stops replication.
trepctl online -force
18.104.22.168.6. Going Online without Validating Checksum
In the event of a checksum problem in the THL, checksums can be
disabled using the
trepctl online -no-checksum
This will bring the replicator online without reading or writing
Use of the
option disables both the reading and writing of checksums on log
records. If starting the replicator without checksums to get past a
checksum failure, the replicator should be taken offline again once
the offending event has been replicated. This will avoid generating
too many local records in the THL without checksums.