1. OGG五大进程的功能
-
Manager进程是GoldenGate的控制进程,运行在源端和目标端上。它主要作用有以下几个方面:启动、监控、重启Goldengate的其他进程,报告错误及事件,分配数据存储空间,发布阀值报告等。在目标端和源端有且只有一个manager进程
-
Extract运行在数据库源端,负责从源端数据表或者日志中捕获数据。Extract的作用可以按照阶段来划分为:
– 初始时间装载阶段:在初始数据装载阶段,Extract进程直接从源端的数据表中抽取数据
– 同步变化捕获阶段:初始数据同步完成以后,Extract进程负责捕获源端数据的变化(DML和DDL) -
Data Pump进程运行在数据库源端,其作用是将源端产生的本地trail文件,把trail以数据块的形式通过TCP/IP 协议发送到目标端,这通常也是推荐的方式。pump进程本质是extract进程的一种特殊形式,如果不使用trail文件,那么extract进程在抽 取完数据以后,直接投递到目标端,生成远程trail文件。
-
Collector进程与Data Pump进程对应 的叫Server Collector进程,这个进程不需要引起我的关注,因为在实际操作过程中,无需我们对其进行任何配置,所以对我们来说它是透明的。它运行在目标端,其 任务就是把Extract/Pump投递过来的数据重新组装成远程trail文件。
-
Replicate进程,通常我们也把它叫做应用进程。运行在目标端,是数据传递的最后一站,负责读取目标端trail文件中的内容,并将其解析为DML或 DDL语句,然后应用到目标数据库中。
2. OGG 对接 Kafka
1. Kafka安装
zookeeper
-
下载;
-
部署;
– 路径自己选择 -
设置环境变量:
Export zookeeper=/home/**/kafka/zookeeper Export PATH=$zookeeper:$PATH
-
修改zookeeper/conf下的配置文件:
zoo_sample.cfg ; Datadir :$ZOOKEEPER_HOME/data;端口默认
-
启动zookeeper:
zookeeper/bin/.zkSerer.sh start sudo 执行