You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "chenyz1984 (via GitHub)" <gi...@apache.org> on 2025/02/14 01:10:51 UTC

[I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

chenyz1984 opened a new issue, #8702:
URL: https://github.com/apache/seatunnel/issues/8702

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0:
   ```
   [INFO] 2025-02-14 03:02:06.717 +0800 -  -> 
   	2025-02-14 03:02:05,826 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1484593
   	Write Count So Far        :             1468193
   	Average Read Count        :             11129/s
   	Average Write Count       :             10920/s
   	Last Statistic Time       : 2025-02-14 03:01:05
   	Current Statistic Time    : 2025-02-14 03:02:05
   	***********************************************
   	
   [INFO] 2025-02-14 03:03:06.723 +0800 -  -> 
   	2025-02-14 03:03:05,820 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1584593
   	Write Count So Far        :             1568193
   	Average Read Count        :              1694/s
   	Average Write Count       :              1694/s
   	Last Statistic Time       : 2025-02-14 03:02:05
   	Current Statistic Time    : 2025-02-14 03:03:05
   	***********************************************
   	
   [INFO] 2025-02-14 03:04:06.728 +0800 -  -> 
   	2025-02-14 03:04:05,874 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1584593
   	Write Count So Far        :             1568193
   	Average Read Count        :                 0/s
   	Average Write Count       :                 0/s
   	Last Statistic Time       : 2025-02-14 03:03:05
   	Current Statistic Time    : 2025-02-14 03:04:05
   	***********************************************
   	
   [INFO] 2025-02-14 03:05:06.732 +0800 -  -> 
   	2025-02-14 03:05:05,813 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1584593
   	Write Count So Far        :             1568193
   	Average Read Count        :                 0/s
   	Average Write Count       :                 0/s
   	Last Statistic Time       : 2025-02-14 03:04:05
   	Current Statistic Time    : 2025-02-14 03:05:05
   	***********************************************
   	
   [INFO] 2025-02-14 03:06:06.737 +0800 -  -> 
   	2025-02-14 03:06:05,813 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1584593
   	Write Count So Far        :             1568193
   	Average Read Count        :                 0/s
   	Average Write Count       :                 0/s
   	Last Statistic Time       : 2025-02-14 03:05:05
   	Current Statistic Time    : 2025-02-14 03:06:05
   	***********************************************
   	
   [INFO] 2025-02-14 03:07:06.742 +0800 -  -> 
   	2025-02-14 03:07:05,779 INFO  org.apache.seatunnel.engine.client.job.JobMetricsRunner - 
   	***********************************************
   	           Job Progress Information
   	***********************************************
   	Job Id                    :  942495351481303043
   	Read Count So Far         :             1584593
   	Write Count So Far        :             1568193
   	Average Read Count        :                 0/s
   	Average Write Count       :                 0/s
   	Last Statistic Time       : 2025-02-14 03:06:05
   	Current Statistic Time    : 2025-02-14 03:07:05
   	***********************************************
   ```
   
   ### SeaTunnel Version
   
   2.3.9
   
   ### SeaTunnel Config
   
   ```conf
   seatunnel:
     engine:
       http:
         enable-http: true
         port: 8090
         context-path: /seatunnel    
       history-job-expire-minutes: 1440     # 历史作业过期时长(分钟) 
       backup-count: 1                      # Imap 数据的副本数,2 表示每个数据会同时存储在2个不同的节点中。因 Master 宕机而不足时,自动补齐
       queue-type: blockingqueue
       classloader-cache-mode: true
       print-execution-info-interval: 60
       print-job-metrics-info-interval: 60
       slot-service:                        # Slot 数量决定了 Worker 节点可以并行运行的任务组数量。此配置对 Master 节点无效,只对 Worker 节点有效。
         dynamic-slot: false                # true 表示不限制 slot 数量(自动)。建议将 dynamic-slot 设置为 false,同时增加 slot-num 并设置为 'CPU核心数 x2',以防止 OOM
         slot-num: 128                       # 将 dynamic-slot 设置为 false,同时增加 slot-num 并设置为 'CPU 核心数 x2',以防止 OOM
       job-schedule-strategy: WAIT          # 当资源不足时,作业的调度策略:WAIT 等待资源可用;REJECT 拒绝作业(默认配置)。当 dynamic-slot 为 true 时,此配置强制为 REJECT。
       checkpoint:
         interval: 300000
         timeout: 120000
         storage:
           type: hdfs
           max-retained: 3
           plugin-config:
             namespace: /seatunnel/checkpoint/    # 持久化存储 checkpoint 的路径,必须以 / 结尾
             storage.type: hdfs 
             
             
             fs.defaultFS: hdfs://sybdata # Ensure that the directory has written permission
               
             seatunnel.hadoop.dfs.nameservices: sybdata  # sybdata
             seatunnel.hadoop.dfs.ha.namenodes.sybdata: nn1,nn2
              
             seatunnel.hadoop.dfs.namenode.rpc-address.sybdata.nn1: h77005:8020  
             seatunnel.hadoop.dfs.namenode.rpc-address.sybdata.nn2: h77006:8020 
             seatunnel.hadoop.dfs.client.failover.proxy.provider.sybdata: org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
               
               
             
   
   map:                                       # IMap 数据持久化设置
     engine*:
       map-store:
         enabled: true
         initial-mode: EAGER
         factory-class-name: org.apache.seatunnel.engine.server.persistence.FileMapStoreFactory
         properties:
           type: hdfs                       # 持久化存储类型,仅支持 hdfs
           namespace: /seatunnel/imap   # 持久化存储 imap 的路径
           clusterName:    # 用于区分不同的 seatunnel 集群
           storage.type: hdfs
           fs.defaultFS: hdfs://sybdata
   ```
   
   ### Running Command
   
   ```shell
   ${SEATUNNEL_HOME}/bin/seatunnel.sh --config /tmp/dolphinscheduler/exec/process/seatunnel/132587039644032/132927532342660_71/73/736/seatunnel_73_736.conf --deploy-mode cluster -n BAT_JIUYE_AC12_PK -i BY_DAY_BEGIN=${BY_DAY_BEGIN} -i BY_DAY_END=${BY_DAY_END}
   ```
   
   ### Error Exception
   
   ```log
   没有日志报错,但读写速度始终为0/s,并且任务一直在运行。
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta 2.3.9
   
   ### Java or Scala Version
   
   java 1.8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "chenyz1984 (via GitHub)" <gi...@apache.org>.
chenyz1984 commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-2658038725

   作业配置:
   
   ```yml
   env {
     parallelism = 8
     job.mode = "BATCH"
     # checkpoint.interval = 300000
   }
   source{
     Jdbc {
       url = "jdbc:oracle:thin:@//10.65.178.2:51511/pdb2"
       driver = "oracle.jdbc.OracleDriver"
       user = "shearddata"
       password = "SYldjy_2025"
       connection_check_timeout_sec = 100
       table_path = "LNJY.AC12",
       query = """
   SELECT * FROM LNJY.AC12 
    WHERE (
          ZAE036 >= TRUNC(TO_DATE('"""${BY_DAY_BEGIN}"""', 'yyyyMMdd'),'DD') 
      AND ZAE036 <  TRUNC(TO_DATE('"""${BY_DAY_END}"""', 'yyyyMMdd'),'DD')
          ) 
       OR ZAE036 IS NULL
       """
       partition_column = "AAC120"  
       split.size = 20000
       plugin_output = "AC12_SRC"
     }
     Jdbc {
       url = "jdbc:oracle:thin:@//10.65.178.2:51511/pdb2"
       driver = "oracle.jdbc.OracleDriver"
       user = "shearddata"
       password = "SYldjy_2025"
       connection_check_timeout_sec = 100
       table_path = "LNJY.AC12",
       query = """
   SELECT COUNT(1) AS SRC_TOTAL_COUNT,
          SUM(
             CASE WHEN (
                       ZAE036 >= TRUNC(TO_DATE('"""${BY_DAY_BEGIN}"""', 'yyyyMMdd'),'DD') 
                   AND ZAE036 <  TRUNC(TO_DATE('"""${BY_DAY_END}"""', 'yyyyMMdd'),'DD')
                     ) 
                    OR ZAE036 IS NULL
                  THEN 1
                  ELSE 0 END
                 ) AS READ_COUNT
     FROM LNJY.AC12
       """
       split.size = 20000
       plugin_output = "AC12_CNT"
     }
   }
   
   transform {
     Sql {
       plugin_input = "AC12_SRC"
       plugin_output = "AC12"
       query = "SELECT *, NOW() AS PTIME FROM AC12_SRC"
     }
     Sql {
       plugin_input = "AC12_CNT"
       plugin_output = "AC12_RPT"
       query = """
   SELECT '人社_就业' AS TABLE_CLASS,
          'AC12' AS TABLE_NAME,
          CURRENT_DATE() AS SYNC_DATE,
          SRC_TOTAL_COUNT,
          READ_COUNT,
          NOW() AS BEGIN_TIME,
          CAST(NULL AS INT) AS DEST_TOTAL_COUNT, 
          CAST(NULL AS INT) AS WRITE_COUNT,
          CAST(NULL AS TIMESTAMP) AS END_TIME 
     FROM AC12_CNT
       """
     }  
   }
   sink {
     jdbc {
       url = "jdbc:mysql://10.65.178.2:3306/rensheju?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
       driver = "com.mysql.cj.jdbc.Driver"
       user = "rensheju"
       password = "Sysz2024"
       connection_check_timeout_sec = 60
       max_retries = 3
       transaction_timeout_sec = 30
       generate_sink_sql = true
       database = "rensheju"
       table = "AC12"
       plugin_input = "AC12"
       schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
       data_save_mode = "APPEND_DATA"
       batch_size = 20000
       enable_upsert = true        # 默认 true。当只有 insert 操作时,将此选项设置为 false,可提高性能
       primary_keys = ["AAC120"]
     }
     jdbc {
       url = "jdbc:mysql://10.65.178.2:3306/rensheju?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
       driver = "com.mysql.cj.jdbc.Driver"
       user = "rensheju"
       password = "Sysz2024"
       connection_check_timeout_sec = 60
       max_retries = 3
       transaction_timeout_sec = 30
       generate_sink_sql = true
       plugin_input = "AC12_RPT"
       database = "rensheju"
       table = "st_sync_rpt"
       schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
       data_save_mode = "APPEND_DATA"
       batch_size = 20000
       enable_upsert = true        # 默认 true。当只有 insert 操作时,将此选项设置为 false,可提高性能
       primary_keys = ["TABLE_CLASS","TABLE_NAME","SYNC_DATE"]
     }  
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-3064420594

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "acttk (via GitHub)" <gi...@apache.org>.
acttk commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-2696569007

   如何解决始终为0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-3092661176

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "chenyz1984 (via GitHub)" <gi...@apache.org>.
chenyz1984 commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-2715859181

   > 感觉性能和datax差别这么大呢, oracle同步到oceanbase的mysql模式, 
   > datax每秒12万行, SeaTunnel只有四五千......
   > 目前生产环境准备用datax了, 想着试一下,差别也太多了吧, 没有优化的datax,每秒也将近2万行, 优化后每秒5Mb;
   > 是我的姿势不对么;
   > 我照着你的配置下再试试...
   
   主要是传说中的社区活跃,根本没人啊。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "Joe12-24 (via GitHub)" <gi...@apache.org>.
Joe12-24 commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-2713317841

   感觉性能和datax差别这么大呢, oracle同步到oceanbase的mysql模式, 
   datax每秒12万行, SeaTunnel只有四五千......
   目前生产环境准备用datax了, 想着试一下,差别也太多了吧, 没有优化的datax,每秒也将近2万行, 优化后每秒5Mb;
   是我的姿势不对么;
   我照着你的配置下再试试...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8702: [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0
URL: https://github.com/apache/seatunnel/issues/8702


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] 基于主键批量同步Oracle至MySQL时,Average Read Count与Average Write Count始终为0 [seatunnel]

Posted by "chenyz1984 (via GitHub)" <gi...@apache.org>.
chenyz1984 commented on issue #8702:
URL: https://github.com/apache/seatunnel/issues/8702#issuecomment-2699253665

   > 如何解决始终为0
   
   还没解决,技术社区咨询,也没人回应。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org