OGG安装
环境介绍,为了节省资源OGG我选择和原库安装在了同一台服务器
软件版本 | IP地址 |
---|---|
OGG21.3 | 192.168.2.251 |
Mysql8.0.11 | 192.168.2.251 |
Mysql8.0.11 | 192.168.2.252 |
1.1 解压ogg的安装包
上传并解压mysql ogg安装包,无需安装解压即可使用
# mkdir /ogg
# unzip 213000_ggs_Linux_x64_MySQL_64bit.zip
# tar -xvf ggs_Linux_x64_MySQL_64bit.tar
1.2 Mysql数据库配置
源库配置
OGG21C可以使用基于日志的DDL复制,要求添binlog_row_metadata为full模式才可以实现
# vi /etc/my.cnf
[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
socket=/tmp/mysql.sock
user=mysql
port=3306
character-set-server=utf8mb4
symbolic-links=0
server_id = 1
log_bin = mysql-bin
expire_logs_days = 1
binlog_format = row
binlog_row_metadata=full
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
目标库配置
[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
socket=/tmp/mysql.sock
user=mysql
port=3306
character-set-server=utf8mb4
symbolic-links=0
server_id = 2
log_bin = mysql-bin
expire_logs_days = 1
binlog_format = row
binlog_row_metadata=full
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
主备数据库创建同步用户并附权
CREATE USER 'ogg'@'%' IDENTIFIED BY 'Sandata@123';
GRANT ALL PRIVILEGES ON *.* TO 'ogg'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
1.3 OGG配置
在21C的OGG中ogg可以单独部署并不需要每台服务器都安装,只要网络可达即可
[root@mysql ogg]# ./ggsci
Oracle GoldenGate Command Interpreter for MySQL
Version 21.3.0.0.0 OGGCORE_21.3.0