The following endpoints are available for the whole replicator :
services
status
version
online
offline
purge
reset
The replicators existing services can be listed with GET
request as follows
GET 'https://127.0.0.1:8097/api/v2/replicator/services'
The output will look like
{
"payloadType": "ServicesPayload",
"payloadVersion": "1",
"payload": [
{
"serviceType": "unknown",
"appliedLastSeqno": -1,
"relativeLatency": -1,
"role": "slave",
"appliedLatency": -1,
"masterConnectUri": "thl://centos1:2112/",
"started": true,
"state": "OFFLINE:ERROR",
"serviceName": "east"
},
{
"serviceType": "local",
"appliedLastSeqno": 28,
"relativeLatency": 434041.992,
"role": "master",
"appliedLatency": 1.138,
"masterConnectUri": "thls://localhost:/",
"started": true,
"state": "ONLINE",
"serviceName": "west"
}
]
}
The status of the replicator services will be retrieved using a GET
request as follows
GET 'https://127.0.0.1:8097/api/v2/replicator/status'
This will show the individual status of all the replicator services, as this example shows:
{
"payloadType": "ReplicatorStatusPayload",
"payloadVersion": "1",
"payload": {
"east": {
"appliedLastEventId": "NONE",
"appliedLastSeqno": -1,
"appliedLatency": -1,
"autoRecoveryEnabled": false,
"autoRecoveryTotal": 0,
"channels": -1,
"clusterName": "east",
"currentEventId": "NONE",
"currentTimeMillis": 1646836106399,
"dataServerHost": "continuent4",
"extensions": "",
"host": "continuent4",
"latestEpochNumber": -1,
"masterConnectUri": "thl://centos1:2112/",
"masterListenUri": "thl://continuent4:2112/",
"maximumStoredSeqNo": -1,
"minimumStoredSeqNo": -1,
"offlineRequests": "NONE",
"pendingError": "Event application failed: seqno=10 fragno=0 message=Table »
mats.ct1351 not found in database. Unable to generate a valid statement.",
"pendingErrorCode": "NONE",
"pendingErrorEventId": "mysql-bin.000015:0000000000368340;-1",
"pendingErrorSeqno": 10,
"pendingExceptionMessage": "Table mats.ct1351 not found in database. Unable »
to generate a valid statement.",
"pipelineSource": "UNKNOWN",
"relativeLatency": -1,
"resourceJdbcDriver": "org.drizzle.jdbc.DrizzleDriver",
"resourceJdbcUrl": "jdbc:mysql:thin://continuent4:3306/${DBNAME}? »
jdbcCompliantTruncation=false&zeroDateTimeBehavior=convertToNull& »
tinyInt1isBit=false&allowMultiQueries=true&yearIsDateType=false",
"resourcePrecedence": 99,
"resourceVendor": "mysql",
"rmiPort": 10000,
"role": "slave",
"seqnoType": "java.lang.Long",
"serviceName": "east",
"serviceType": "unknown",
"simpleServiceName": "east",
"siteName": "default",
"sourceId": "continuent4",
"state": "OFFLINE:ERROR",
"timeInStateSeconds": 434526.394,
"timezone": "GMT",
"transitioningTo": "",
"uptimeSeconds": 434526.967,
"useSSLConnection": false,
"version": "Tungsten Replicator 7.0.0"
},
"west": {
"appliedLastEventId": "mysql-bin.000016:0000000000010112;-1",
"appliedLastSeqno": 28,
"appliedLatency": 1.138,
"autoRecoveryEnabled": false,
"autoRecoveryTotal": 0,
"channels": 1,
"clusterName": "west",
"currentEventId": "mysql-bin.000016:0000000000010112",
"currentTimeMillis": 1646836106401,
"dataServerHost": "continuent4",
"extensions": "",
"host": "continuent4",
"latestEpochNumber": 28,
"masterConnectUri": "thls://localhost:/",
"masterListenUri": "thls://continuent4:2112/",
"maximumStoredSeqNo": 28,
"minimumStoredSeqNo": 0,
"offlineRequests": "NONE",
"pendingError": "NONE",
"pendingErrorCode": "NONE",
"pendingErrorEventId": "NONE",
"pendingErrorSeqno": -1,
"pendingExceptionMessage": "NONE",
"pipelineSource": "jdbc:mysql:thin://continuent4:3306/tungsten_west? »
noPrepStmtCache=true&allowMultiQueries=true&stripQueryComments=false& »
enabledProtocols=TLSv1.3,TLSv1.2,TLSv1.1&enabledCipherSuites= »
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, »
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, »
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, »
TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA&connectTimeout=15",
"relativeLatency": 434526.401,
"resourceJdbcDriver": "org.drizzle.jdbc.DrizzleDriver",
"resourceJdbcUrl": "jdbc:mysql:thin://continuent4:3306/${DBNAME}? »
jdbcCompliantTruncation=false&zeroDateTimeBehavior=convertToNull& »
tinyInt1isBit=false&allowMultiQueries=true&yearIsDateType=false",
"resourcePrecedence": 99,
"resourceVendor": "mysql",
"rmiPort": 10000,
"role": "master",
"seqnoType": "java.lang.Long",
"serviceName": "west",
"serviceType": "local",
"simpleServiceName": "west",
"siteName": "default",
"sourceId": "continuent4",
"state": "ONLINE",
"timeInStateSeconds": 434526.28,
"timezone": "GMT",
"transitioningTo": "",
"uptimeSeconds": 434526.479,
"useSSLConnection": true,
"version": "Tungsten Replicator 7.0.0"
}
}
}
Optional parameters can be added to specify the kind of status. the following parameters are:
channel_assignments
services
shards
stages
stores
tasks
watches
For example, to view the status of tasks, issue:
GET 'https://127.0.0.1:8097/api/v2/replicator/status?statusType=tasks'
Which will produce output similar to the following example:
{
"payloadType": "ReplicatorStatusByTypePayload",
"payloadVersion": "1",
"payload": {
"type": "tasks",
"status": {
"west": [
{
"lastCommittedBlockTime": "1.037",
"currentLastSeqno": "28",
"extractTime": "1.034",
"currentLastEventId": "mysql-bin.000016:0000000000010112;-1",
"eventCount": "1",
"filterTime": "0.0",
"appliedLastSeqno": "28",
"averageBlockSize": "0.500 ",
"appliedLastEventId": "mysql-bin.000016:0000000000010112;-1",
"stage": "binlog-to-q",
"currentBlockSize": "0",
"appliedLatency": "1.123",
"cancelled": "false",
"commits": "2",
"otherTime": "0.0",
"timeInCurrentEvent": "434695.351",
"currentLastFragno": "0",
"state": "extract",
"applyTime": "0.0",
"taskId": "0",
"lastCommittedBlockSize": "1"
},
{
"lastCommittedBlockTime": "1.068",
"currentLastSeqno": "28",
"extractTime": "1.034",
"currentLastEventId": "mysql-bin.000016:0000000000010112;-1",
"eventCount": "1",
"filterTime": "0.0",
"appliedLastSeqno": "28",
"averageBlockSize": "0.500 ",
"appliedLastEventId": "mysql-bin.000016:0000000000010112;-1",
"stage": "q-to-thl",
"currentBlockSize": "0",
"appliedLatency": "1.123",
"cancelled": "false",
"commits": "2",
"otherTime": "0.001",
"timeInCurrentEvent": "434695.336",
"currentLastFragno": "0",
"state": "extract",
"applyTime": "0.015",
"taskId": "0",
"lastCommittedBlockSize": "1"
}
],
"east": []
}
}
}
This GET
request returns the running version of the replicator
GET 'https://127.0.0.1:8097/api/v2/replicator/version'
{
"payloadType": "StringPayload",
"payloadVersion": "1",
"payload": {
"value": "Tungsten Replicator 7.0.0"
}
}
For more precise version of the replicator, another GET
request can be used
GET 'https://127.0.0.1:8097/api/v2/tungstenVersion'
{
"payloadType": "VersionPayload",
"payloadVersion": "1",
"payload": {
"productName": "Tungsten Replicator",
"versionMajor": 7,
"versionMinor": 0,
"versionRevision": 0,
"versionBuild": null,
"tungstenVersion": "Tungsten Replicator 7.0.0"
}
}
These endpoints allows putting all services online / offline.
This is a POST
request sent, for example
POST 'https://127.0.0.1:8097/api/v2/replicator/online'
POST 'https://127.0.0.1:8097/api/v2/replicator/offline'
This will return a task via a TaskPayload
as below
{
"payloadType": "TaskPayload",
"payloadVersion": "1",
"payload": {
"taskId": "ecaed8a7-5b57-4a76-a1a5-a2de14d9cc79",
"state": "in_progress",
"operation": "OnlineTask"
}
}
Both operations accept an input payload (OnlinePayload
/ OfflinePayload
). An example is shown below :
{
"payloadType": "OnlinePayload",
"payloadVersion": "1",
"payload": {
"options": [
{
"type":"toHeartbeat",
"value":"stop"
}
]
}
}
This endpoint purges all non-tungsten connections connected to the different services.
This is a POST
request as follows
POST 'https://127.0.0.1:8097/api/v2/replicator/purge'
A PurgePayload
can be provided to specify a timeout. This will return a TaskPayload
as an online call, for example.
This endpoint resets all replicator services.
This is a POST
request as follows
POST 'https://127.0.0.1:8097/api/v2/replicator/reset'
A ResetPayload
can be provided to specify what should be reseted, for exmaple:
{
"payloadType": "ResetPayload",
"payloadVersion": "1",
"payload": {
"type": "thl"
}
}
Valid values for the type are : all, db, thl, relay
This will return a TaskPayload
as an online call, for example.