flume案例-文件数据采集-运行测试

启动 Flume

cd /export/servers/apache-flume-1.6.0-cdh5.14.0-bin
bin/flume-ng agent -c conf -f conf/tail-file.conf -n agent1 -Dflume.root.logger=INFO,c

开发 Shell 脚本定时追加文件内容

mkdir -p /export/servers/shells/
cd /export/servers/shells/
vim tail-file.sh
#!/bin/bash
while true
do
date >> /export/servers/taillogs/access_log;
sleep 0.5;
done

启动脚本

# 创建文件夹
mkdir -p /export/servers/taillogs
# 启动脚本
sh /export/servers/shells/tail-file.sh
发布了2281 篇原创文章 · 获赞 52 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/Leon_Jinhai_Sun/article/details/104596771