dm-v1.0.5使用

DM使用V1.0.5版本,线上共创建了100+的WORKER任务,给业务做各种数据同步任务,目前官方支持的几种同步方式都在线上运行,且使用超过6个月时间,挺稳定的,高峰期存在一定延期及其他。

使用过程需要注意的有:
    1、源端表存在大小写问题,到TIDB默认变小写,需要在TASK增加参数
设置大小写敏感:case-sensitive:true
    2、源端MySQL大事务,代码归档不能超过4G,若超了…
停止task,手动把BINLOG移动到relay_log目录里
    3、提高DM对下游写入能力,优化sync参数,可根据配置酌情调整
#备份、导入、同步

      

4、增加连接心跳检查参数,账号需要有DDL权限
           enable-heartbeat: false
       5、业务库通过最好是要有一定的规则,在分库分表合并比较好处理,如库名db_xxx_0xo....db_xxx_0ox 表名类似
             目前遇到匹配规则有些情况下不是很满足,通过业务改造规范处理
       6、目标端记录的dm_meta信息非常重要,不要轻易处理
            如果想把任务重新搞,不改taskname名字,可以删除同步表数据、或DROP
       7、DM写入慢,目前遇到处理办法
            1、查看TIKV 是否IOUNTIL比较高,可能磁盘IO性能不行,换盘
            2、分库分表多实例下,多个DM 使用一个TIDB,也会引起慢,资源充足下可以为每个TASK配置一个TIDB-SERVER
            3、调整syncers的参数
            4、根据实际情况优化同步业务表(分表合并方案,官方对于写入热点建议有参数设置)
       8、任务名称规则,不能带有点号格式
       9、增量同步数据需要注意:
           1、update  db_meta.xx  is_global=1修改名字
           2、修改task里的位置点
           3、relay_log里的信息
       10、使用GTID同步BINLOG 可能会遇到,这样问题

            
            改成pos同步即可恢复
       11、分库分表合并,DM默认使用悲观锁,会引起同步延迟,在4096个表批量刷DDL 延迟在一个小时左右
           官方有可改成乐观模式,没验证过,不知道会不会对数据准确性产生问题
      12、DM同步也支持有损修改,算是TIDB特性 

      13、记得加监控,有延迟及时告警,能够及时处理
           目前处理:上游同步BINLOG个数减去已经消费的个数>1做提示

       

 14、做好各种异常冲突告警(数据冲突等)

 

15、DM切换源端同步点,主要修改is_global=1,delete掉is_global=0

        在分库分表合并中,遇到不清理会遇到同步状态没问题,数据实际没同步问题

 16、目前DM完成的管理,可以配置管理、WOKRER控制、TASK控制,部分功能还在改进

    

17、使用过程中DM 为什么能够保证数据一致性,比有些CDC牛逼,这方面的原理还是要学习

     要是能够根据数据值进行CDC 这个就更加完美,目前只能根据事件

18、为什么不用新版本

       看选择,目前这个还是比较稳定,有些业务已经使用了2年多了,挺稳的

(pytorch) C:\Users\jh>pip list Package Version Build ---------------------------- -------------- ----- absl-py 2.1.0 aiohappyeyeballs 2.4.3 aiohttp 3.10.10 aiosignal 1.3.1 annotated-types 0.7.0 anyio 4.4.0 argon2-cffi 23.1.0 argon2-cffi-bindings 21.2.0 arrow 1.3.0 arviz 0.19.0 asttokens 2.4.1 astunparse 1.6.3 async-lru 2.0.4 attrs 24.2.0 babel 2.16.0 beautifulsoup4 4.12.3 bleach 6.1.0 Brotli 1.1.0 build 1.2.1 cachetools 5.4.0 certifi 2024.7.4 cffi 1.17.1 chardet 5.2.0 charset-normalizer 3.3.2 click 8.1.7 cloudpickle 3.0.0 colorama 0.4.6 comm 0.2.2 cons 0.4.6 contourpy 1.2.1 cryptography 43.0.3 cycler 0.12.1 debugpy 1.8.5 decorator 5.1.1 defusedxml 0.7.1 distro 1.9.0 dm-tree 0.1.8 elasticsearch7 7.17.12 esda 2.7.0 et-xmlfile 1.1.0 etuples 0.3.9 executing 2.1.0 factor_analyzer 0.5.1 Farama-Notifications 0.0.4 fastjsonschema 2.20.0 filelock 3.15.4 flatbuffers 24.3.25 fonttools 4.53.1 fqdn 1.5.1 frozenlist 1.5.0 fsspec 2024.6.1 funcy 2.0 gast 0.6.0 gensim 4.3.3 geopandas 1.0.1 google-ai-generativelanguage 0.6.6 google-api-core 2.19.1 google-api-python-client 2.141.0 google-auth 2.33.0 google-auth-httplib2 0.2.0 google-generativeai 0.7.2 google-pasta 0.2.0 googleapis-common-protos 1.63.2 grpcio 1.65.4 grpcio-status 1.62.3 gym 0.26.2 gym-notices 0.0.8 gymnasium 0.29.1 h11 0.14.0 h5netcdf 1.3.0 h5py 3.11.0 httpcore 1.0.5 httplib2 0.22.0 httpx 0.27.2 idna 3.7 imageio 2.37.0 inflate64 1.0.1 ipykernel 6.29.5 ipython 8.27.0 ipywidgets 8.1.5 isoduration 20.11.0 Janome 0.5.0 jedi 0.19.1 jieba 0.42.1 Jinja2 3.1.4 jiter 0.5.0 joblib 1.4.2 json5 0.9.25 jsonpointer 3.0.0 jsonschema 4.23.0 jsonschema-specifications 2023.12.1 jupyter 1.1.1 jupyter_client 8.6.2 jupyter-console 6.6.3 jupyter_core 5.7.2 jupyter-events 0.10.0 jupyter-lsp 2.2.5 jupyter_server 2.14.2 jupyter_server_terminals 0.5.3 jupyterlab 4.2.5 jupyterlab_pygments 0.3.0 jupyterlab_server 2.27.3 jupyterlab_widgets 3.0.13 keras 3.6.0 kiwisolver 1.4.5 libclang 18.1.1 libpysal 4.13.0 lightgbm 4.6.0 logical-unification 0.4.6 lxml 5.3.0 Markdown 3.7 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.9.2 matplotlib-inline 0.1.7 mdurl 0.1.2 miniKanren 1.0.3 mistune 3.0.2 ml-dtypes 0.4.1 mpmath 1.3.0 multidict 6.1.0 multipledispatch 1.0.0 multivolumefile 0.2.3 namex 0.0.8 nbclient 0.10.0 nbconvert 7.16.4 nbformat 5.10.4 nest-asyncio 1.6.0 networkx 3.3 nltk 3.9.1 notebook 7.2.2 notebook_shim 0.2.4 numexpr 2.10.2 numpy 1.26.4 openai 1.54.4 openpyxl 3.1.5 opt-einsum 3.3.0 optree 0.13.1 overrides 7.7.0 packaging 24.1 pandas 2.2.2 pandocfilters 1.5.1 parso 0.8.4 patsy 0.5.6 pdfminer.six 20240706 pgmpy 0.1.26 pillow 10.4.0 pip 25.1.1 pip-tools 7.4.1 platformdirs 4.3.2 plotly 5.24.0 prometheus_client 0.20.0 prompt_toolkit 3.0.47 propcache 0.2.0 proto-plus 1.24.0 protobuf 4.25.4 psutil 6.0.0 pure_eval 0.2.3 py7zr 0.22.0 pyasn1 0.6.0 pyasn1_modules 0.4.0 pybcj 1.0.6 pycparser 2.22 pycryptodomex 3.22.0 pydantic 2.8.2 pydantic_core 2.20.1 pydot 3.0.4 Pygments 2.18.0 pyLDAvis 3.4.1 pymc 5.16.2 pyogrio 0.10.0 pyparsing 3.1.2 pyppmd 1.1.1 pyproj 3.7.1 pyproject_hooks 1.1.0 pytensor 2.25.2 python-dateutil 2.9.0.post0 python-docx 1.1.2 python-dotenv 1.0.1 python-json-logger 2.0.7 pytz 2024.1 pywin32 306 pywinpty 2.0.13 PyYAML 6.0.2 pyzmq 26.2.0 pyzstd 0.16.2 rarfile 4.2 referencing 0.35.1 regex 2024.7.24 requests 2.32.3 rfc3339-validator 0.1.4 rfc3986-validator 0.1.1 rich 13.7.1 rpds-py 0.20.0 rsa 4.9 scikit-learn 1.5.1 scipy 1.13.1 seaborn 0.13.2 Send2Trash 1.8.3 setuptools 73.0.1 shapely 2.1.0 six 1.16.0 smart-open 7.1.0 sniffio 1.3.1 soupsieve 2.6 stable_baselines3 2.3.2 stack-data 0.6.3 statsmodels 0.14.2 sympy 1.13.2 tenacity 9.0.0 tensorboard 2.18.0 tensorboard-data-server 0.7.2 tensorflow 2.18.0 tensorflow_intel 2.18.0 termcolor 2.5.0 terminado 0.18.1 texttable 1.7.0 threadpoolctl 3.5.0 tinycss2 1.3.0 toolz 0.12.1 torch 2.4.0 torchaudio 2.4.0 torchvision 0.19.0 1 tornado 6.4.1 tqdm 4.66.5 traitlets 5.14.3 types-python-dateutil 2.9.0.20240906 typing_extensions 4.12.2 tzdata 2024.1 uri-template 1.3.0 uritemplate 4.1.1 urllib3 2.2.3 wcwidth 0.2.13 webcolors 24.8.0 webencodings 0.5.1 websocket-client 1.8.0 Werkzeug 3.1.3 wheel 0.44.0 widgetsnbextension 4.0.13 wordcloud 1.9.4 wrapt 1.17.0 xarray 2024.7.0 xarray-einstats 0.7.0 xgboost 2.1.1 xlrd 2.0.1 yarl 1.17.1 (pytorch) C:\Users\jh>python Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import torch Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\jh\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\__init__.py", line 148, in <module> raise err OSError: [WinError 126] 找不到指定的模块。 Error loading "C:\Users\jh\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies. >>>
06-29
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值