renyupeng 3 سال پیش
والد
کامیت
60912786b5
1فایلهای تغییر یافته به همراه19 افزوده شده و 18 حذف شده
  1. 19 18
      monitor/ApplicationCDCMonitor.py

+ 19 - 18
monitor/ApplicationCDCMonitor.py

@@ -45,24 +45,25 @@ class ApplicationCDCMonitor:
                 backResult = requests.get(
                     url='http://{}:{}{}/{}'.format(self.cdc_url, self.cdc_port, self.cdc_changefeeds_url, task_id),
                     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:
                 logging.info("无异常")