|
@@ -30,9 +30,14 @@ class ApplicationCDCMonitor:
|
|
headers=headers)
|
|
headers=headers)
|
|
errrepo = requests.get(url='http://{}:{}{}?state=error'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
errrepo = requests.get(url='http://{}:{}{}?state=error'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url),
|
|
headers=headers)
|
|
headers=headers)
|
|
- print(errrepo.json(),'---error---')
|
|
|
|
|
|
+ errtask = errrepo.json()
|
|
|
|
+ if errtask is not None:
|
|
|
|
+ os.system(
|
|
|
|
+ '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 '
|
|
|
|
+ '--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']
|
|
@@ -45,7 +50,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),
|