惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - margiex

OGG的一些常用网址 ogg初始化抽取的快速配置方法一: 将存量数据落地为标准trail GoldenGate 21c发布 OGG配置文件中参数化的运用 GoldenGate基于中间队列文件的初始化 一次linux中毒,挖矿病毒 goldengate新版本中查看日志读取点 ogg同步Oracle数据库用户验证 GoldenGate在MySQL 集群中的应用 Oracle GoldenGate现在支持从 PostgreSQL 捕获数据 GoldenGate 2020.7 发布新特性 - 19.1.0.0.200714 GoldenGate如何修改抽取进程的读取点? 使用AutoHotKey提升工作效率 InnoDB和NDB,MySQL群集和InnoDB群集之间有什么区别? GoldenGate 19.1实时文本文件加载攻略 windows 10 excel 打开超连接提示 组织策略阻止... 验证ogg同步数据库表无主键表且目标表包含隐藏字段 配置ogg从Oracle到PostgreSQL的同步复制json数据 pi
利用GoldenGate 21实现mysql8远程DDL同步
margiex · 2021-08-30 · via 博客园 - margiex

测试架构

配置

修改mysql8的配置my.cnf

[mysqld]
server_id=1
#binlog-ignore-db=oggddl
binlog_format=ROW
log-bin=mysql-bin
log_bin_index=/var/lib/mysql/mysql-bin.index
max_binlog_size=1073741824 
binlog_row-metadata=FULL  # for DDl replication in 8.0
#log_bin_basename=/var/lib/mysql/binlog
chown -R mysql.mysql /var/lib/mysql
service mysqld restart

创建ogg同步用户

CREATE USER 'ogg'@'%' IDENTIFIED BY 'ogg';
GRANT ALL PRIVILEGES ON *.* TO 'ogg'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

ogg param参数配置

ogg extract

extract exm8
sourcedb testdb@192.168.7.91:3306, userid etl, password ogg
tranLogOptions altlogDest REMOTE
ddl include mapped
exttrail ./dirdat/m8
table testdb.*;
add ext exm8, tranlog, begin now
add exttrail ./dirdat/m8, ext exm8

replicat

replicat re57
targetdb testdb@192.168.7.20:3306, userid ogg, password ogg
map testdb.*, target testdb.*;
add rep re57, exttrail ./dirdat/m8, nodbcheckpoint

测试

db operation

mysql> create table tb2 (id int, name varchar(50), age int);
Query OK, 0 rows affected (0.04 sec)
mysql> insert into tb2 values (1,'222',33) ,(2,'abc',44);
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

ogg 同步信息

抽取进程

GGSCI> stats exm8, total

Sending STATS request to Extract group EXM8 ...
Start of statistics at 2021-08-30 16:37:42.
DDL replication statistics (for all trails):
*** Total statistics since extract started     ***
        Operations                                         1.00
        Mapped operations                                  1.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00

Output to ./dirdat/m8:
Extracting from testdb.tb2 to testdb.tb2:

*** Total statistics since 2021-08-30 16:37:36 ***
    Total inserts                              2.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           2.00

End of statistics.

投递进程

GGSCI (ol76db DBLOGIN as ogg) 54> stats re57, total
Sending STATS request to Replicat group RE57 ...
Start of statistics at 2021-08-30 17:11:02.

DDL replication statistics:
*** Total statistics since replicat started     ***
        Operations                                         1.00
        Mapped operations                                  1.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00
        Errors                                             0.00
        Retried errors                                     0.00
        Discarded errors                                   0.00
        Ignored errors                                     0.00

Replicating from testdb.tb2 to testdb.tb2:

*** Total statistics since 2021-08-30 17:10:52 ***
    Total inserts                              2.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           2.00

End of statistics.

小结

利用GoldenGate 21,可实现MySQL 8.0的远程同步,包括DDL同步,且不需要额外的DDL安装配置,该版本简化了MySQL之间的数据同步。如有必要,也可以从MySQL5.7同步到MySQL8.0,从而实现数据库的升级迁移。