当前位置: 首页 > 工具软件 > Maxwell > 使用案例 >

Maxwell 配置

卫念
2023-12-01
默认支持kafka的版本为1.0.0

MySQL端的支持传统复制和GTID复制(Maxwell 1.8版本+)

# cat config.properties |grep -v '#' |grep -v '^$'
producer=kafka
log_level=INFO
host=172.16.4.101
user=maxwell
password=maxwell
schema_database=maxwell-td
# replication 表示的是MySQL的数据库,maxwell的源库
replication_host=10.19.196.129
replication_user=maxwell
replication_password=maxwell
replication_port=3312
output_server_id=true
# kafka的相关配置
kafka.bootstrap.servers=kafka1.hadoop.xyz.com:9092,kafka2.hadoop.xyz.com:9092,kafka3.hadoop.xyz.com:9092
kafka_topic=maxwell_order_main
kafka.compression.type=snappy
kafka.retries=3
kafka.acks=-1
producer_partition_by=primary_key
kafka_partition_hash=murmur3
# 过滤的配置
filter= exclude: *.*,include: yjp_admin.city,include: /yjp_order_\\d+/.jiupiorder, include: /yjp_order_\\d+/.orderitem, include: /yjp_order_\\d+/.orderitemamount,include: /yjp_order_\\d+/.orderitemprice, include: /yjp_order_\\d+/.orderitemproduct, include: /yjp_order_\\d+/.orders, include: /yjp_order_\\d+/.orderproperty, include: /yjp_order_\\d+/.orderenvironment,include: /yjp_order_\\d+/.returnorder, include: /yjp_order_\\d+/.returnorderitem, include: /yjp_order_\\d+/.orderbatch,include: /yjp_bizuserwallet_\\d+/.couponcode,include: /yjp_productsku_\\d+/.productinfo, include: /yjp_productsku_\\d+/.productsku,include: /yjp_productsku_\\d+/.productinfospecification, include: /yjp_productsku_\\d+/.productinfodisplaycategory
# 监控
metrics_type=jmx,http
metrics_jvm=true
http_port=8091
http_diagnostic=true
client_id=pro-maxwell-td
replica_server_id=9000
# 提高吞吐性能
kafka.acks = 1
kafka.compression.type = snappy
kafka.retries=0
#  at-least-once delivery
kafka.acks = all
kafka.retries = 5 # or some larger number

参考:

http://maxwells-daemon.io/producers/#kafka

 类似资料: