一、环境要求MySQL 企业版或者社区版
OGG for MySQL 12.2.0.2
OGG Application Adapter 12.2.0.1
java 7(推荐JDK 1.8)
二、安装步骤:
(下面将介绍MySQL/OGG相关安装和配置过程,MySQL的安装将不做介绍,另外需要注意的是:MySQL/OGG相关参数配置以熟悉MySQL/OGG的运维人员配置为准,本示例只是提供一个可运行的样本)
安装包准备
相关安装包可以在文末的提示下进行下载。
OGG for MySQL
OGG Adater
DataHub OGG Plugin
OGG 源端配置
1. 源端MySQL配置
开启binlog
修改文件/etc/my.cnf,添加如下配置
## for ogg
# Extract expects that all of the table columns are in the binary log.
# As a result, only binlog_row_image set as full is supported and this is the default
binlog_row_image=full
# It must be set to the value of ROW, which directs the database to log DML statements in binary format.
binlog_format=row
# prevents DDL logging history table entries in the binlog
binlog-ignore-db=oggddl
# binlog path
log-bin=/usr/local/mysql/logs/log
# binlog index path
log-bin-index=/usr/local/mysql/logs/binlog.index
# enable binlog must set server-id, you can modify if there are multiple services
server-id=1
修改完成后重启MySQL服务。
创建DB和user
mysql连接MySQL服务之后,输入以下命令创建DB
# 创建ogg测试用的数据库ggtt
create database ggtt;
## 创建ogg测试用的用户ogg_test
grant all privileges on ggtt.*to'ogg_test'@'localhost