flume整合kafka+zookeeper

1、启动flume

 bin/flume-ng agent --conf conf/ -f conf/flume.conf -n producer

下面试flume.conf的配置文件

#memory channel called ch1 on agent1

producer.channels.channel1.type = memory

 

# Define an Avro source called avro-source1 on agent1 and tell it

# to bind to 0.0.0.0:41414. Connect it to channel ch1.

producer.sources.source1.channels = channel1

producer.sources.source1.type = syslogudp

producer.sources.source1.bind = 127.0.0.1

producer.sources.source1.port = 41414

 

# Define a logger sink that simply logs all events it receives

# and connect it to the other end of the same channel.

producer.sinks.sink1.channel = channel1

producer.sinks.sink1.type = org.apache.flume.plugins.KafkaSink

producer.sinks.sink1.metadata.broker.list=127.0.0.1:9092

producer.sinks.sink1.custom.partition.key=kafkaPartition

producer.sinks.sink1.custom.topic.name=kafkaTopic

producer.sinks.sink1.serializer.class=kafka.serializer.StringEncoder

 

# Finally, now that we've defined all of our components, tell

# agent1 which ones we want to activate.

producer.channels = channel1

producer.sources = source1

producer.sinks = sink1

2、启动kafka

bin/zookeeper-server-start.sh config/zookeeper.properties--启动zookeeper
 
bin/kafka-server-start.sh config/server.properties--启动kafkaServer
3、执行echo 'wo l g q .' |nc -u localhost 41414 把信息输出到41414端口
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning   --启动consumer查看是否接受到信息

项目核心代码结构截图

分布式框架介绍 - kafkaee - kafkaee的博客

   项目模块依赖

分布式框架介绍 - kafkaee - kafkaee的博客

特别提醒:开发人员在开发的时候可以将自己的业务REST服务化或者Dubbo服务化

2.    项目依赖介绍

   2.1 后台管理系统、Rest服务系统、Scheculer定时调度系统依赖如下图:

 

分布式框架介绍 - kafkaee - kafkaee的博客

       2.2 Dubbo独立服务项目依赖如下图:

 

分布式框架介绍 - kafkaee - kafkaee的博客

3.  项目功能部分截图:

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客
 

zookeeper、dubbo服务启动 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客
 

dubbo管控台 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 REST服务平台

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

 

转载于:https://my.oschina.net/qiuwenshuo/blog/735840

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值