apache flume单机安装、运行

来源:互联网 发布:买备案域名要多少钱 编辑:程序博客网 时间:2024/05/22 13:06

最近项目打算做一个日志收集功能,打算用flume,在这里开一个系列博客,记录我在实战用flume如何使用

官方下载flume,截止写这个博客时,官方最新1.7

https://flume.apache.org

下载到服务器,解压出来。

接在在conf文件夹中创建flume.conf文件,在flume.conf中写入以下sample内容,内容来自官网,只是用来做测试使用,请勿 放到生产

# example.conf: A single-node Flume configuration# Name the components on this agenta1.sources = r1a1.sinks = k1a1.channels = c1# Describe/configure the sourcea1.sources.r1.type = netcata1.sources.r1.bind = localhosta1.sources.r1.port = 44444# Describe the sinka1.sinks.k1.type = logger# Use a channel which buffers events in memorya1.channels.c1.type = memorya1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channela1.sources.r1.channels = c1a1.sinks.k1.channel = c1

接着执行启动命令

 flume-ng agent --conf conf --conf-file flume.conf --name a1 -Dflume.root.logger=INFO,console

执行命令会显示下面内容

[root@esslog-shqs-4 conf]# flume-ng agent --conf conf --conf-file flume.conf --name a1 -Dflume.root.logger=INFO,consoleInfo: Including Hive libraries found via () for Hive access+ exec /service/storm/jdk1.8.0_111/bin/java -Xmx20m -Dflume.root.logger=INFO,console -cp 'conf:/service/storm/flume/lib/*:/lib/*' -Djava.library.path= org.apache.flume.node.Application --conf-file flume.conf --name a1log4j:WARN No appenders could be found for logger (org.apache.flume.lifecycle.LifecycleSupervisor).log4j:WARN Please initialize the log4j system properly.log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

纠结了半天,将命令改成如下

flume-ng agent --conf /service/storm/flume/conf --conf-file flume.conf --name a1 -Dflume.root.logger=INFO,console

–conf需要指定绝对路径。

调整配置再次启动,如下
image

0 0
原创粉丝点击