|
@@ -45,24 +45,25 @@ class ApplicationCDCMonitor:
|
|
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),
|
|
headers=headers)
|
|
headers=headers)
|
|
- if backResult is 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=task_id))
|
|
|
|
- else:
|
|
|
|
- result = backResult.json()
|
|
|
|
- print(result)
|
|
|
|
- if result['error'] is not None:
|
|
|
|
- requests.delete(url='http://{}:{}{}/{}'.format(self.cdc_url, self.cdc_port,
|
|
|
|
- self.cdc_changefeeds_url, task_id))
|
|
|
|
- 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=task_id))
|
|
|
|
- else:
|
|
|
|
- logging.info('新创建没有问题')
|
|
|
|
|
|
+ print(backResult, '--------1111-------')
|
|
|
|
+ # if backResult is 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=task_id))
|
|
|
|
+ # else:
|
|
|
|
+ # result = backResult.json()
|
|
|
|
+ # print(result)
|
|
|
|
+ # if result['error'] is not None:
|
|
|
|
+ # requests.delete(url='http://{}:{}{}/{}'.format(self.cdc_url, self.cdc_port,
|
|
|
|
+ # self.cdc_changefeeds_url, task_id))
|
|
|
|
+ # 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=task_id))
|
|
|
|
+ # else:
|
|
|
|
+ # logging.info('新创建没有问题')
|
|
else:
|
|
else:
|
|
logging.info("无异常")
|
|
logging.info("无异常")
|
|
|
|
|