Skip to main content
Common Reference

trepctl services

The trepctl services command outputs a list of the current replicator services configured in the system and their key parameters such as latest sequence numbers, latency, and state.

Usage
trepctl services [ options ]

Where:

OptionDescriptionVersion
-c nUsed with the -r option to refresh the services display n number of times.7.0.2
-fullOutput detailed service information
-jsonOutput the service information in JSON format
-r nAuto-Refresh the output every n seconds, where n is an integer value in seconds. Refresh until CTRL+C is pressed

For more information on the fields displayed, see "Generated Field Reference".

For a replicator with multiple services, the information is output for each configured service:

shell> trepctl services

Processing services command...
NAME VALUE
---- -----
appliedLastSeqno: 44
appliedLatency : 0.692
role : master
serviceName : alpha
serviceType : local
started : true
state : ONLINE
NAME VALUE
---- -----
appliedLastSeqno: 40
appliedLatency : 0.57
role : slave
serviceName : beta
serviceType : remote
started : true
state : ONLINE
NAME VALUE
---- -----
appliedLastSeqno: 41
appliedLatency : 0.06
role : slave
serviceName : gamma
serviceType : remote
started : true
state : ONLINE
Finished services command...

Using -c and -r

For convenience, the display can be set to refresh with a configured interval using the -r option, passing a value in seconds for the auto-refresh. This can be cancelled by using CTRL+C.

shell> trepctl services -r 5

The -c option can also be used with the -r option to limit the number of refresh iterations. For example, the command below would refresh every 5 seconds for a total of 10 iterations before exiting to the command prompt:

shell> trepctl services --c 10 -r 5

Processing services command...
NAME VALUE
---- -----
appliedLastSeqno: 2541
appliedLatency : 0.48
role : master
serviceName : alpha
serviceType : local
started : true
state : ONLINE
Finished services command...

Getting JSON Formatted Status

The information can be reported in JSON format by using the -json option to the command:

shell> trepctl services -json

[
{
"serviceType" : "local",
"appliedLatency" : "0.48",
"serviceName" : "alpha",
"appliedLastSeqno" : "2541",
"started" : "true",
"role" : "master",
"state" : "ONLINE"
}
]

The information is output as an array of objects, one object for each service identified.

Using -full

If the -full option is added, the output includes full details of the service. This is the same as running trepctl reset or, for hosts with multiple services, trepctl -all-services status.

The -full can also be combined with the -json option, for example:

shell> trepctl services -json -full

[
{
"serviceType":"local",
"sourceId":"db1",
"appliedLastGoodSeqno":"221",
"role":"master",
"pendingErrorEventId":"NONE",
"timezone":"GMT","siteName":"default"
,"useSSLConnection":"false",
"pipelineSource":"\/var\/lib\/mysql",
"uptimeSeconds":"298.328",
"resourceJdbcDriver":"org.drizzle.jdbc.DrizzleDriver",
"appliedLastEventId":"mysql-bin.000016:0000000000000959;3309",
"seqnoType":"java.lang.Long",
"pendingExceptionMessage":"NONE",
"resourceVendor":"mysql",
"appliedLatency":"0.448",
"clusterName":"alpha",
"host":"db1",
"state":"ONLINE",
"rmiPort":"10000",
"resourceJdbcUrl":"jdbc:mysql:thin:\/\/db1:13306\/${DBNAME}?jdbcCompliantTruncation=false&zeroDateTimeBehavior=convertToNull&tinyInt1isBit=false&allowMultiQueries=true&yearIsDateType=false",
"simpleServiceName":"alpha",
"pendingErrorCode":"NONE",
"masterConnectUri":"thl:\/\/localhost:\/",
"pendingErrorSeqno":"-1",
"latestEpochNumber":"221",
"started":"true",
"offlineRequests":"NONE",
"timeInStateSeconds":"2.395",
"minimumStoredSeqNo":"0",
"serviceName":"alpha",
"currentEventId":"mysql-bin.000016:959",
"autoRecoveryTotal":"0",
"version":"Tungsten Replicator 8.0.2 build 87",
"masterListenUri":"thl:\/\/db1:2112\/",
"transitioningTo":"",
"appliedLastSeqno":"221",
"dataServerHost":"db1",
"appliedLastGoodLatency":"0.448",
"relativeLatency":"2.785",
"extensions":"",
"channels":"1",
"currentTimeMillis":"1740496159786",
"maximumStoredSeqNo":"221",
"pendingError":"NONE",
"autoRecoveryEnabled":"false"
}
]