|
@@ -28,16 +28,19 @@ class ApplicationCDCMonitor:
|
|
headers = {'Content-Type': 'application/json'}
|
|
headers = {'Content-Type': 'application/json'}
|
|
repo = requests.get(url='http://{}:{}{}?'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
repo = requests.get(url='http://{}:{}{}?'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
headers=headers)
|
|
headers=headers)
|
|
- errrepo = requests.get(url='http://{}:{}{}?state=error'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
|
|
- headers=headers)
|
|
|
|
|
|
+ errrepo = requests.get(
|
|
|
|
+ url='http://{}:{}{}?state=error'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
|
|
+ headers=headers)
|
|
errtask = errrepo.json()
|
|
errtask = errrepo.json()
|
|
if errtask is not None:
|
|
if errtask is not None:
|
|
|
|
+ errtask_id = errtask['id']
|
|
|
|
+ print(errtask, '-----error--------')
|
|
os.system(
|
|
os.system(
|
|
'cd /data/tidb-deploy/cdc-8300/bin; ./cdc cli changefeed create --pd=http://192.168.0.184:2379 '
|
|
'cd /data/tidb-deploy/cdc-8300/bin; ./cdc cli changefeed create --pd=http://192.168.0.184:2379 '
|
|
'--sink-uri="mysql://data:hcst@2021@139.186.27.96:3390" --config ../conf/{task_id}.toml '
|
|
'--sink-uri="mysql://data:hcst@2021@139.186.27.96:3390" --config ../conf/{task_id}.toml '
|
|
- '--changefeed-id={task_id} '.format(task_id=errtask['id']))
|
|
|
|
|
|
+ '--changefeed-id={task_id} '.format(task_id=errtask_id))
|
|
message = repo.json()
|
|
message = repo.json()
|
|
- #print(message)
|
|
|
|
|
|
+ # print(message)
|
|
for json in message:
|
|
for json in message:
|
|
task_id = json['id']
|
|
task_id = json['id']
|
|
tso = json['checkpoint_tso']
|
|
tso = json['checkpoint_tso']
|
|
@@ -50,7 +53,7 @@ class ApplicationCDCMonitor:
|
|
'cd /data/tidb-deploy/cdc-8300/bin; ./cdc cli changefeed create --pd=http://192.168.0.184:2379 '
|
|
'cd /data/tidb-deploy/cdc-8300/bin; ./cdc cli changefeed create --pd=http://192.168.0.184:2379 '
|
|
'--sink-uri="mysql://data:hcst@2021@139.186.27.96:3390" --config ../conf/{task_id}.toml '
|
|
'--sink-uri="mysql://data:hcst@2021@139.186.27.96:3390" --config ../conf/{task_id}.toml '
|
|
'--changefeed-id={task_id} --start-ts {tso}'.format(tso=tso, task_id=task_id))
|
|
'--changefeed-id={task_id} --start-ts {tso}'.format(tso=tso, task_id=task_id))
|
|
- #print(status)
|
|
|
|
|
|
+ # print(status)
|
|
|
|
|
|
backResult = requests.get(
|
|
backResult = requests.get(
|
|
url='http://{}:{}{}/{}'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url, task_id),
|
|
url='http://{}:{}{}/{}'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url, task_id),
|