首页 > 其他 > 详细

Maxwell编译

时间:2019-06-27 16:52:13      阅读:243      评论:0      收藏:0      [点我收藏+]
Maxwell简介

Maxwell是一个能实时读取MySQL二进制日志binlog,并生成 JSON 格式的消息,作为生产者发送给 Kafka,Kinesis、RabbitMQ、Redis、Google Cloud Pub/Sub、文件或其它平台的应用程序。它的常见应用场景有ETL、维护缓存、收集表级别的dml指标、增量到搜索引擎、数据分区迁移、切库binlog回滚方案等。官网(http://maxwells-daemon.io)

编译Maxwell

导入Maxwell源码到IDEA
技术分享图片
编译完成后生成target文件夹,注意,在打package之前先clean
技术分享图片
把新编译出来的maxwell-1.22.1.tar.gz上传到服务器

[hadoop@hadoop004 maxwell-1.22.1]$ vim config.properties
# mysql options

user = maxwell
password = Aaron123456#
host= hadoop004
jdbc_options = useSSL=false&serverTimezone=Asia/Shanghai
schema_database = maxwell
ignore_producer_error = true

# sync tables

include_dbs=hello
include_tables=people

producer = kafka
kafka_topic = DSHS

# kafka produce options

kafka.batch.size = 10000
kafka.max.request.size = 2097152
kafka.request.timeout.ms = 360000

kafka.acks = all
kafka.compression.type = snappy
kafka.metadata.fetch.timeout.ms= 360000
kafka.retries= 100

# kafka.linger.ms = 500

kafka.max.in.flight.requests.per.connection = 1
kafka.timeout.ms = 360000
kafka.buffer.memory = 536870912
kafka.max.block.ms = 1800000

kafka.bootstrap.servers=hadoop004:9092

# kafka producer partition

producer_partition_by=primary_key

# kafka monitor

metrics_type=http
metrics_http_port=8083

或者直接在IDEA直接启动
技术分享图片
启动Kafka

bin/kafka-topics.sh --create --zookeeper hadoop004:2181 --replication-factor 1 --partitions 1 --topic DSHS

bin/zookeeper-server-start.sh -daemon config/zookeeper.properties

bin/kafka-server-start.sh -daemon config/server.properties

bin/kafka-console-consumer.sh --zookeeper localhost:2181/kafka --topic DSHS --from-beginning
[hadoop@hadoop004 maxwell-1.22.1]$ bin/maxwell --kafka_version 0.10.0.1 --config config.properties

技术分享图片
技术分享图片


?  bin pwd
/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin

?  bin sh mvn install:install-file -Dfile=/Users/Aaron/Downloads/fuxing/phoenix-4.10.0-cdh5.12.0/phoenix-4.10.0-cdh5.12.0-client.jar -DgroupId=org.apache.phoenix -DartifactId=phoenix-client -Dversion=4.10.0-cdh5.12.0 -Dpackaging=Jar

Maxwell编译

原文:https://blog.51cto.com/14309075/2414261

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!