重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
这篇文章主要为大家展示了“Flume如何安装”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Flume如何安装”这篇文章吧。
宣州ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联建站的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!
一、下载/解压缩
[root@hadoop0 opt]# wget http://mirror.bit.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
--1999-05-08 19:02:36-- http://mirror.bit.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
Resolving mirror.bit.edu.cn... 114.247.56.117
Connecting to mirror.bit.edu.cn|114.247.56.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52550402 (50M) [application/octet-stream]
Saving to: apache-flume-1.6.0-bin.tar.gz
100%[===========================>] 52,550,402 621K/s in 1m 41s
1999-05-08 19:04:17 (507 KB/s) - apache-flume-1.6.0-bin.tar.gz saved [52550402/52550402]
[root@hadoop0 opt]# tar -zxvf apache-flume-1.6.0-bin.tar.gz
[root@hadoop0 opt]# cd apache-flume-1.6.0-bin
[root@hadoop0 apache-flume-1.6.0-bin]# ./bin/flume-ng help
Usage: ./bin/flume-ng
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
--classpath,-C
--dryrun,-d do not actually start Flume, just print the command
--plugins-path
plugins.d section in the user guide for more details.
Default: $FLUME_HOME/plugins.d
-Dproperty=value sets a Java system property value
-Xproperty=value sets a Java -X option
agent options:
--name,-n
--conf-file,-f
--zkConnString,-z
--zkBasePath,-p
--no-reload-conf do not reload config file if changed
--help,-h display help text
avro-client options:
--rpcProps,-P
--host,-H
--port,-p
--dirname
--filename,-F
--headerFile,-R
--help,-h display help text
Either --rpcProps or both --host and --port must be specified.
Note that if
in the classpath.
二、增加配置文件
[root@hadoop0 apache-flume-1.6.0-bin]# vi conf/hw.conf
agent.sources=s1
agent.channels=c1
agent.sinks=k1
agent.sources.s1.type=netcat
agent.sources.s1.channels=c1
agent.sources.s1.bind=192.168.1.111
agent.sources.s1.port=12345
agent.channels.c1.type=memory
agent.sinks.k1.type=logger
agent.sinks.k1.channel=c1
三、启动、验证
[root@hadoop0 apache-flume-1.6.0-bin]
# ./bin/flume-ng agent -n agent -c conf -f conf/hw.conf -Dflume.root.logger=INFO,console
[root@hadoop0 ~]# netstat -tnpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9447 0.0.0.0:* LISTEN 1349/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1304/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1538/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1382/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1618/master
tcp 0 0 :::111 :::* LISTEN 1304/rpcbind
tcp 0 0 :::13683 :::* LISTEN 1349/rpc.statd
tcp 0 0 :::22 :::* LISTEN 1538/sshd
tcp 0 0 ::1:631 :::* LISTEN 1382/cupsd
tcp 0 0 ::1:25 :::* LISTEN 1618/master
[root@hadoop0 ~]# nc -l 12345
nc: Address already in use
[root@hadoop0 ~]# nc localhost 12345
[root@hadoop0 ~]# nc 192.168.1.111 12345
sdfsdfdsf
OK
sdfsdfsdf
OK
gaojingsong
OK
whomai
OK
四、验证结果
以上是“Flume如何安装”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!