Flume URL: http://archive.apache.org/dist/flume/1.6.0/
Step 1: 在上面下载1.6版本的Flume
Step 2: 在任意一个节点上执行命令:
mkdir -p /opt/apps/FlumeStep 3: 使用xftp将下载的文件上传到该目录下
Step 4: 执行命令:———-进行解压
tar -zxvf /opt/apps/Flume/apache-flume-1.6.0-bin.tar.gzStep 5: 在节点执行命令:—–配置FLUME_HOME环境变量
vi ~/.bash_profile source ~/.bash_profile export FLUME_HOME=/opt/apps/Flume/apache-flume-1.6.0-bin export PATH=$PATH:$FLUME_HOME/binStep 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 agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1.sources.r1.type = netcat a1.sources.r1.bind = node11 a1.sources.r1.port = 44444 # Describe the sink a1.sinks.k1.type = logger # Use a channel which buffers events in memory a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1Step 7: 在node11节点上执行命令:
mount /dev/cdrom /mnt/Step 8: 在node11节点上执行命令:下图证明已经安装了
yum -y install telnetStep 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,consoleStep 10: 在node11节点上重新开一个终端,然后执行命令 telnet node11 444444
Step 11: 发送消息,然后Flume接收