Flume最早是Cloudera提供的日志收集系统,目前是Apache下的一个孵化项目,Flume支持在日志系统中定制各类数据发送方,用于收集数据。
本文记录一下在CentOS 6.7上,安装flume的步骤,为后期日志收集做准备 :)
下载安装包
本文使用flume-1.7.0, 使用wget获取flume安装包。
[root@dev18 flume]# wget http://ftp.wayne.edu/apache/flume/1.7.0/apache-flume-1.7.0-bin.tar.gz --2017-01-22 15:59:53-- http://ftp.wayne.edu/apache/flume/1.7.0/apache-flume-1.7.0-bin.tar.gz Resolving ftp.wayne.edu... 141.217.0.199 Connecting to ftp.wayne.edu|141.217.0.199|:80... connected. HTTP request sent,awaiting response... 200 OK Length: 55711670 (53M) [application/x-gzip] Saving to: “apache-flume-1.7.0-bin.tar.gz” 100%[====================================================================================================================================================================================================================================>] 55,711,670 91.1K/s in 9m 5s 2017-01-22 16:08:59 (99.8 KB/s) - “apache-flume-1.7.0-bin.tar.gz” saved [55711670/55711670] [root@dev18 flume]#
解压缩
使用tar -zvxf apache-flume-1.7.0-bin.tar.gz 解压缩安装包
[root@dev18 flume]# tar -zvxf apache-flume-1.7.0-bin.tar.gz
配置环境变量
使用vim /etc/proflile命令,打开profile文件,
[root@dev18 flume]# vim /etc/proflile
然后添加FLUME_NAME和FLUME_CONF_DIR变量,如
export FLUME_HOME=/srv/flume/flume export FLUME_CONF_DIR=$FLUME_HOME/conf PATH=$FLUME_HOME/bin:$PATH export PATH
执行source /etc/profile命令使变量生效
[root@dev18 flume]# source /etc/profile
验证安装
可以使用flume-ng version命令来查看,flume安装是否成功。
[root@dev18 flume]# flume-ng version Flume 1.7.0 Source code repository: https://git-wip-us.apache.org/repos/asf/flume.git Revision: 511d868555dd4d16e6ce4fedc72c2d1454546707 Compiled by bessbd on Wed Oct 12 20:51:10 CEST 2016 From source with checksum 0d21b3ffdc55a07e1d08875872c00523 [root@dev18 flume]#
至此,flume的简单安装就完成了。
原文链接:https://www.f2er.com/centos/378935.html