Code Monkey home page Code Monkey logo

yugong's Introduction

yugong

[TOC]

目的

  • SQL Server -> MySQL 的一致性检查(CHECK)
  • MySQL -> SQL Server 的回滚(SYNC)

获得 yugong jar 包

方法一:编译 yugong jar 包:

git [email protected]:hjarch-practice/yugong.git
cd yugong
mvn clean package
cp target/yugong-shaded.jar .

方法二: 不想编译的同学, 直接点击 Tags · HJArch-Internal / yugong · GitLab , 找到里面最新的版本,里面有 jar 包下载。

配置文件

有两个配置文件:

  • properties,配置数据库信息和作业信息
  • YAML 配置文件,做 Translator 定制化

修改配置文件,可以参考其他产线已经在用的配置: Files · master · HJArch-Internal / yugong-conf · GitLab

运行

HJ 使用的 yugong 已经改为 fat jar 模式运行,摒弃了官方的打包流程。 将生成的 fat jar yugong-shaded.jar 拷贝到服务器,即可运行。

运行参数:

  • -c:使用的 yugong properties,配置数据库信息和作业信息
  • -y:使用的 YAML 配置文件,做 Translator 定制化

运行命令:

java -jar yugong-shaded.jar -c sync-mssql-mysql.properties -y mssql-mysql.yaml

PS:如果想优化运行速度,可以加入 JAVA_OPTIONS

JAVA_OPTIONS=("-Xms2048m" "-Xmx3072m" "-Xmn1024m" "-XX:SurvivorRatio=2" "-XX:PermSize=96m" "-XX:MaxPermSize=256m" "-Xss256k" "-XX:-UseAdaptiveSizePolicy" "-XX:MaxTenuringThreshold=15" "-XX:+DisableExplicitGC" "-XX:+UseConcMarkSweepGC" "-XX:+CMSParallelRemarkEnabled" "-XX:+UseCMSCompactAtFullCollection" "-XX:+UseFastAccessorMethods" "-XX:+UseCMSInitiatingOccupancyOnly" "-XX:+HeapDumpOnOutOfMemoryError")
java -server $JAVA_OPTIONS -jar yugong-shaded.jar -c sync-mssql-mysql.properties -y mssql-mysql.yaml

运行之后的错误检查

所有错误日志在 logs 目录下面,范例如下:

logs
├── HJ_OpenPlatform.UserGroups  # 每张表的日志
│   ├── applier.log  # Applier 日志
│   ├── check.log  # 一致性检查日志
│   ├── extractor.log  # Extractor 日志
│   └── table.log  # 表操作日志
└── yugong
    └── table.log  # yugong 的系统日志

运行之后,需要重点观察 check.logtable.log 确保里面没有 ERROR 信息。

可以通过 grep -r ERROR logs 检查错误。

每次操作会记录进度,用来断点续接。想重新开始跑应用, 需要删除当前目录下的 logs / positioner_data

Quick Start

获取 yugong-shaded.jar 之后,做一下操作可以快速使用 yugong:

需要帮助怎么办?

请联系作者 3D,CCTalk 找我「狄敬超」。

yugong's People

Contributors

agapple avatar spidersq avatar openzyk avatar

Watchers

zhanglei avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.