flume安装配置
发布时间
阅读量:
阅读量
目录
一、安装部署
1、上传flume文件到software
2、解压至module
3、重命名
4、进入conf目录修改文件
5、配置flume环境变量
(1)加入flume变量
(2)刷新文件
二、flume采集测试
1、在flume目录下创建一个logs目录
2、写入官网的例子放入logs目录
3、启动flume
4、安装nc写数据
5、监控44444端口
一、安装部署
1、上传flume文件到software
cd /opt/software
2、解压至module
tar -zxf flume包 -C /opt/module
3、重命名
mv flume包 flume
4、进入conf目录修改文件
cd /opt/module/flume/conf
修改文件
mv flume-env.sh.template flume-env.sh
配置如下内容:
export JAVA_HOME=/opt/module/jdk
5、配置flume环境变量
vi /etc/profile.d/my_env.sh
(1)加入flume变量
#FLUME_HOME
export FLUME_HOME=/opt/module/flume
export PATH=$PATH:$FLUME_HOME/bin
(2)刷新文件
source /etc/profile.d/my_env.sh
二、flume采集测试
这里我们用官网上面的例子即可
1、在flume目录下创建一个logs目录
mkdir logs
2、写入官网的例子放入logs目录
vi flume-logger.conf
添加如下内容
# 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 = localhost
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 = c1
3、启动flume
flume-ng agent -n a1 -c conf -f logs/flume-logger.conf -Dflume.root.logger=INFO,console
4、安装nc写数据
yum install nc
5、监控44444端口
nc localhost 44444
成功后在下方写数据,flume接收到即为成功
全部评论 (0)
还没有任何评论哟~
