第一范文网 - 专业文章范例文档资料分享平台

flume安装部署手册-new - 图文(3)

来源:用户分享 时间:2019-03-29 本文由霜雪落满头 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

4.2. 启动Apache Flume Client

Apache Flume Client可以运行在任何安装有Apache Flume环境的主机上,只要和运行Apache Flume Agent的主机网络上相通。 运行命令如下:

flume-ng avro-client -H \

我们在测试环境中针对Apache Flume Client的启停编写了shell脚本,该脚本会将运行目录下所有的文件传输到Apache Flume Agent。启动脚本如下:

#!/bin/bash

local_file_dir=/home/hadoop/mr_data/hw

local_bak_dir=/home/hadoop/mr_data/back_up/hw avro_host=10.32.147.241 avro_port=4141

status_file=/home/hadoop/apache-flume-1.2.0/conf/status_file

Flume-NG安装部署说明11 / 14

if [ ! -d \

echo \ exit 1 fi

if [ ! -d \

echo \ exit 2 fi

if [ ! -f \ touch \

echo $(date) > \fi

echo \cd \if [ 0 -ne $? ]; then

echo \ exit 3 fi

while [ -f $status_file ] do

for filename in $(ls -lrt | awk '{print $9}') do

echo \

if [ \ continue fi

if [[ -n \ echo \

flume-ng avro-client -H \-p \-filename

\

echo \

mv \ fi done

sleep 10

done

Flume-NG安装部署说明12 / 14

停止脚本如下:

#!/bin/bash

status_file=status_file

echo \

if [ -f \ rm -f \ if [ 0 -eq $? ]; then

echo \ else

echo \ fi else

echo \fi

4.3. 停止Apache Flume

Apache Flume并没有提供停止的命令,所以要停止Apache Flume需要kill进程号

[hadoop@cassdb 20120917]$ ps -ef | grep flume [hadoop@cassdb 20120917]$ kill -9 进程号

4.4. Apache Flume命令

Usage: ./flume-ng [options]...

commands:

help display this help text agent run a Flume agent avro-client run an avro Flume client version show Flume version info

global options:

--conf,-c use configs in directory --classpath,-C append to the classpath

--dryrun,-d do not actually start Flume, just print the command -Dproperty=value sets a JDK system property value

agent options:

--conf-file,-f specify a config file (required)

--name,-n the name of this agent (required) --help,-h display help text

Flume-NG安装部署说明13 / 14

avro-client options:

--host,-H hostname to which events will be sent (required) --port,-p port of the avro source (required)

--filename,-F text file to stream to avro source [default: std input]

--headerFile,-R headerFile containing headers as key/value pairs on each new line --help,-h display help text

Note that if directory is specified, then it is always included first in the classpath.

5. 其它

本手册只对Apache Flume的简单数据流进行了配置(这种配置也是我们目前测试系统中使用的),Apache Flume还支持很多其它的配置方法,其它配置方法的描述请参见:

http://flume.apache.org/FlumeUserGuide.html

Flume-NG安装部署说明14 / 14

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新综合文库flume安装部署手册-new - 图文(3)全文阅读和word下载服务。

flume安装部署手册-new - 图文(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/88904.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top