Skip to content

Maxwell使用

1. 增量数据同步

  1. 启动Maxwell
sh
mxw.sh start
  1. 启动Kafka消费者
sh
[jack@hadoop102 kafka]$ kafka-console-consumer.sh --bootstrap-server hadoop102:9092 --topic topic_db
  1. 手动在gmall数据库的ware_info表中添加一条数据,如下图所示: Alt text
  2. 查看Kafka消费者 Alt text

2. 历史数据全量同步

Maxwell提供了bootstrap功能来进行历史数据的全量同步,命令如下:

sh
./bin/maxwell-bootstrap --database gmall --table ware_info --config /opt/module/maxwell-1.29.2/config.properties