您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“Flume如何安裝”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Flume如何安裝”這篇文章吧。
一、下載/解壓縮
[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 <command> [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 <conf> use configs in <conf> directory
--classpath,-C <cp> append to the classpath
--dryrun,-d do not actually start Flume, just print the command
--plugins-path <dirs> colon-separated list of plugins.d directories. See the
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 <name> the name of this agent (required)
--conf-file,-f <file> specify a config file (required if -z missing)
--zkConnString,-z <str> specify the ZooKeeper connection to use (required if -f missing)
--zkBasePath,-p <path> specify the base path in ZooKeeper for agent configs
--no-reload-conf do not reload config file if changed
--help,-h display help text
avro-client options:
--rpcProps,-P <file> RPC client properties file with server connection params
--host,-H <host> hostname to which events will be sent
--port,-p <port> port of the avro source
--dirname <dir> directory to stream to avro source
--filename,-F <file> text file to stream to avro source (default: std input)
--headerFile,-R <file> File containing event headers as key/value pairs on each new line
--help,-h display help text
Either --rpcProps or both --host and --port must be specified.
Note that if <conf> directory is specified, then it is always included first
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
三、啟動(dòng)、驗(yàn)證
[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
四、驗(yàn)證結(jié)果
以上是“Flume如何安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。