Flume実戦傍受ネットワークポート

1543 ワード

具体的な配置の解釈は公式サイトを参照してください
http://flume.apache.org/FlumeUserGuide.html#flume-sources
1、flumeインストールディレクトリの下に新しいフォルダexample 
2、exampleでファイルを新規作成する 
netcat-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 = nbdo3
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-ng agent -c ../conf -
fnetcat-logger.conf -n a1 -Dflume.root.logger=INFO,console
説明:
-c.../conf flume自身のプロファイルが存在するディレクトリを指定-f conf/netcat-logger.conf  我々が説明する採集スキーム-n a 1を指定する  私たちのagentの名前を指定します
4、clone sessionはtelnetを起動する
telnetコマンドが無効な場合は、telnetをインストールします.博文を参照:http://www.cnblogs.com/yangxia-test/p/4159891.html
5、テスト
telnet入力
hello
world
flumeが傍受した画面

-------------
より多くのJava、Angular、Android、ビッグデータ、J 2 EE、Python、データベース、Linux、Javaアーキテクチャ、:
http://www.cnblogs.com/zengmiaogen/p/7083694.html