You can perform O&M operations for the Store 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 Store component by calling API operations of the CM component.
In the following command, the CM_URL variable indicates the service address of the CM API. In the container of the store, run the following command to obtain the value of CM_URL:
CM_URL=`awk -F= '$0 ~/cm\.url/ {print $2}' /home/ds/supervisor/package/config/drc.properties | sed 's/^[ \t]*//;s/[ \t]*$//'`
Create and start a store
When a task is created in OMS to start incremental resolution, a store is automatically created and started.
Stop a store
# Replace the value of the STORE variable with the actual store name. You can find the store name in the CM component.
STORE=xxx.xxx.xxx.xxx-7100:p_4223***_source-000-0:0000000007
curl "${CM_URL}/crawler/clear" -d "crawler=${STORE}"
Restart a store
# Replace the value of the STORE variable with the actual store name. You can find the store name in the CM component.
STORE=xxx.xxx.xxx.xxx-7100:p_422***_source-000-0:0000000007
curl "${CM_URL}/crawler/restore" -d "crawler=${STORE}"
View the status information of a store
# Replace the value of the STORE variable with the actual store name. You can find the store name in the CM component.
STORE=xxx.xxx.xxx.xxx-7100:p_4223****_source-000-0:0000000007
curl "${CM_URL}/crawler/detail?filters=&crawler=${STORE}"
Response parameters:
crawler.status: indicates whether the store is normal. The store is normal if the value is0, and abnormal if otherwise.crawler.errMsg: the error information about the store when the value ofcrawler.statusis not0.crawler.active: indicates whether the CM component is normal when it collects store information.The value
trueindicates that the CM component is normal. In this case, other fields are collected in a near-real-time manner and trustworthy.The value
falseindicates that the CM component is abnormal. In this case, other fields may fail to reflect the actual status of the store and are untrustworthy. Possible causes:Data writing to the OMS metaDB is abnormal. |
The latency of requests to the OMS metaDB is high, or the requests timed out.
The clocks of the CM server and OMS metaDB are out of synchronization.
Response:
{
"crawler":{
"active":true,
"cfg":"",
"checkpoints":[
[
{
"checkpoint":"xxx.xxx.xxx.xxx:1:1663049355:0:1663049354:1",
"dataSource":"xxx.xxx.xxx.xxx:1",
"dbIp":16843009,
"dbIpString":"xxx.xxx.xxx.xxx",
"dbPort":1,
"fileIdx":1663049355,
"gmt":null,
"msgId":1,
"offset":0,
"timestamp":1663049354
},
{
"checkpoint":"xxx.xxx.xxx.xxx:1:1663295962:662932:1663295962:3940774",
"dataSource":"xxx.xxx.xxx.xxx:1",
"dbIp":16843009,
"dbIpString":"xxx.xxx.xxx.xxx",
"dbPort":1,
"fileIdx":1663295962,
"gmt":null,
"msgId":3940774,
"offset":662932,
"timestamp":1663295962
}
]
],
"datasource":"xxx.xxx.xxx.xxx:1",
"errMsg":"[Fri Sep 16 10:24:07 2022] DRC_500:Store p_4223***_source-000-0.0000000007 started successfully\n",
"location":"111",
"name":"xxx.xxx.xxx.xxx-7104:p_4223****_source-000-0:0000000007",
"port":17008,
"role":"master",
"status":0,
"userData":""
},
"isSuccess":true
}
Destroy a store (proceed with caution)
# Replace the value of the STORE variable with the actual store name. You can find the store name in the CM component.
STORE=xxx.xxx.xxx.xxx-7100:p_4223***_source-000-0:0000000007
curl "${CM_URL}/crawler/destroy" -d "crawler=${STORE}"