Flume的配置

来源:互联网 发布:dom编程艺术配套源码 编辑:程序博客网 时间:2024/05/22 10:37

Flume URL:
http://archive.apache.org/dist/flume/1.6.0/

Step 1:
在上面下载1.6版本的Flume

Step 2:
在任意一个节点上执行命令:

mkdir -p /opt/apps/Flume

这里写图片描述

Step 3:
使用xftp将下载的文件上传到该目录下
这里写图片描述

Step 4:
执行命令:———-进行解压

tar -zxvf /opt/apps/Flume/apache-flume-1.6.0-bin.tar.gz

这里写图片描述

Step 5:
在节点执行命令:—–配置FLUME_HOME环境变量

vi ~/.bash_profilesource ~/.bash_profile
export FLUME_HOME=/opt/apps/Flume/apache-flume-1.6.0-binexport PATH=$PATH:$FLUME_HOME/bin

这里写图片描述

Step 6:
编辑一个配置文件进行测试————-telnet—-node12
vi /opt/apps/Flume/apache-flume-1.6.0-bin/conf/netcat

输入下列代码:

# 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 = node11a1.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

这里写图片描述

Step 7:
在node11节点上执行命令:

mount /dev/cdrom /mnt/

这里写图片描述

Step 8:
在node11节点上执行命令:下图证明已经安装了

yum -y install telnet

这里写图片描述

Step 9:
在node11节点上执行命令:——注意:一定要先开启flume,然后再使用telnet,否则telnet无法连接,显示connection refused

flume-ng agent --conf /opt/apps/Flume/apache-flume-1.6.0-bin/conf --conf-file /opt/apps/Flume/apache-flume-1.6.0-bin/conf/netcat --name a1 -Dflume.root.logger=INFO,console

这里写图片描述

Step 10:
在node11节点上重新开一个终端,然后执行命令
telnet node11 444444
这里写图片描述

Step 11:
发送消息,然后Flume接收
这里写图片描述

这里写图片描述