You can perform O&M operations for the Connector component on the OPS & Monitoring module of the OceanBase Migration Service (OMS) console or by calling API operations of the Cluster Manager (CM) component. This topic describes the O&M operations for the Connector component by calling API operations of the CM component.
O&M operations for Light-Connector
You must perform the following O&M operations on the CM server. In the sample commands, name indicates the name of the Connector directory.
Start Light-Connector
curl -XPOST http://${cm_url}:${cm_port}/connector/task/startByName?taskName=${name}
Stop Light-Connector
curl -XPOST http://${cm_url}:${cm_port}/connector/task/stopByName?taskName=${name}
Update Light-Connector
Before you update Light-Connector, you must stop the connector. In the sample command, source.key=value specifies to update the key in source.json to value. dest.key=value and coordinator.key=value are similar to source.key=value.
curl -XPOST http://${cm_url}:${cm_port}/connector/task/updateByName -d "taskName=${name}" -d "source.key=value"
Update the Java virtual machine (JVM):
curl -XPOST http://${cm_url}:${cm_port}/connector/task/updateByName -d "taskName=${name}" -d "coordinator.connector_jvm_param=-Xms4g -Xmx6g -Xmn2g"
Pull back Light-Connector
Before you pull back Light-Connector, you must stop the connector first.
# Stop the connector
curl -XPOST http://${cm_url}:${cm_port}/connector/task/stopByName?taskName=${name}
# Update the checkpoint
curl -XPOST http://${cm_url}:${cm_port}/connector/task/updateByName -d "taskName=${name}" -d 'source.checkpoint={"{subtopic}":"{timestamp}"}'
# Start the connector
curl -XPOST 'http://${cm_url}:${cm_port}/connector/task/startByName?taskName=${name}&resume=false'
Migrate Light-Connector
Before you migrate Light-Connector, you must stop the connector first. After the migration, start another connector, whose name is carried in the return value of the migration task.
curl -XGET "http://${cm_url}:${cm_port}/connector/task/migrate?taskName=$c&node=$1"
O&M operations for the Writer component
Stop a writer
curl -XPOST 'http://${cm_url}:${cm_port}/applier/stop' -d "applierName=${writerName}"
Start a writer
curl -XPOST 'http://${cm_url}:${cm_port}/applier/start' -d "applierName=${writerName}"
Delete a writer
curl -XPOST 'http://${cm_url}:${cm_port}/applier/clean' -d "applierName=${writerName}"
Migrate a writer
Before you migrate a writer, you must stop it first. If the writer is not running, skip this step.
curl -XPOST 'http://${cm_url}:${cm_port}/applier/migrate' -d "applierName=${writerName}" -d "node=${IP address of the healthy writer}" -d "force=${true is passed if the writer breaks down, and no value is passed if otherwise.}"
Start another writer. You can obtain the value of writerName in the sample command from the applier field returned by the migration operation.
curl -XPOST 'http://${cm_url}:${cm_port}/applier/start' -d "applierName=${writerName}"
Modify the configurations of a writer
Before you modify the configurations of a writer, you must stop it first.
curl -XPOST 'http://${cm_url}:${cm_port}/applier/update' -d "applierName=${writerName}" -d 'JDBCWriter.key=value'
View the status of a writer
curl -XGET '${cm_url}:${cm_port}/JDBCWriter/detail?writerName=xxx.xxx.xxx.1-9000:p_3b7ixsl2sxb4_source-000-0:0000000069'
Command output:
{
"replicator":{
"active":true,
"cfg":"[JDBCWriter]\ntarget_ob_region=ob_1008***.admin\nlsn_mode=\nstatus=running\nlisten_port=18000\ndaemon.ip=xxx.xxx.xxx.1\ndaemon.port=9000\nlocal_region_no=\nblack_region_no=0\ntenant_mapping=\nignore_ddl=false\nuseMultiExecute=false \nuseDRCNet=true\ncalculate_iops=true\ncoordinatorFile.skipDdl=\nsinkFile.notWriteColumn=\nsrc_type=mysql\nbinlog_username=drc\nbinlog_password=***\ntopic=p_3b7ixsl2sxb4_source\nsubTopic=p_3b7ixsl***_source-000-0\nsrc_subTopic=p_3b7ixsl2sxb4_dest-000-0\nsubId=0000000069\ntimestamp=1639657384\ndest_type=oceanbase1\ncluster.url=http://xxx.xxx.xxx.1:8088\nconfig_url=jdbc:mysql://xxx.xxx.xxx.2:2883?useUnicode=true&allowMultiQueries=true&socketTimeout=50000&characterEncoding=utf8&readOnlyPropagatesToServer=false\nsync_username=root@oms_mysql#ob_10088***.admin\nsync_password=***\nfilter.conditions=baby.*\ntx_records_limit=\nworker_num=16\nconnection_num=\nwriter_type=increment\nretry_sleep=5\ntask.split.mode=false\nblackCondition=[{\"name\":\"test_ddl01\",\"all\":false,\"sub\":[{\"name\":\"DRC_TXN*\",\"func\":\"fn\"},{\"name\":\"drc_txn*\",\"func\":\"fn\"}]}]\nwhiteCondition=[{\"name\":\"test_ddl01\",\"all\":false,\"sub\":[{\"name\":\"*\",\"func\":\"fn\"}]}]\nretry_time=3\nuseDirectUsername=true\ncoordinatorFile.isReverse=true\nprint_sql=false\n",
"checkpoint":{
"checkpoint":"xxx.xxx.xxx.1:0:null:null:1639732207:0",
"dataSource":"xxx.xxx.xxx.1:0",
"dbIp":-1,
"dbIpString":"xxx.xxx.xxx.1",
"dbPort":0,
"fileIdx":null,
"gmt":1639732210,
"msgId":0,
"offset":null,
"timestamp":1639732207
},
"gmtCreated":1639657384000,
"gmtModified":1639657397000,
"ip":"xxx.xxx.xxx.1",
"location":"100",
"name":"xxx.xxx.xxx.1-9000:p_3b7i****_source-000-0:0000000069",
"port":16030,
"status":"running"
},
"isSuccess":true
}
If the value of replicator.active is true, the writer is running. If the value of replicator.active is false, the writer is abnormal. replicator.checkpoint.timestamp indicates the latency, which is the difference between the synchronization timestamp (in seconds) and the current time.
O&M operations for the Checker component
Start a checker
curl http://${cm_url}:${cm_port}/checker/start -d 'task.id=${taskId}' -d 'task.type=migrate' -d 'task.resume=true'
Update a checker
curl http://${cm_url}:${cm_port}/checker/update -d 'task.id=${taskId}' -d 'limitator.table.diff.max=100000'
Pause a checker
curl http://${cm_url}:${cm_port}/checker/stop -d 'task.id=${taskId}' -d 'task.type=migrate'