Flume-ngについて(二)

2236 ワード

私たちのテストを続けます.flumeを編集する.confプロファイル
# Define a memory channel called ch1 on agent1
agent1.channels.ch1.type = memory
# Define an Avro source called avro-source1 on agent1 and tell it
# to bind to 0.0.0.0:41414. Connect it to channel ch1.
agent1.sources.avro-source1.channels = ch1
agent1.sources.avro-source1.type = avro
agent1.sources.avro-source1.bind = 0.0.0.0
agent1.sources.avro-source1.port = 41414
# Define a logger sink that simply logs all events it receives
# and connect it to the other end of the same channel.
agent1.sinks.log-sink1.channel = ch1
agent1.sinks.log-sink1.type = logger
# Finally, now that we've defined all of our components, tell
# agent1 which ones we want to activate.
agent1.channels = ch1
agent1.sources = avro-source1
agent1.sinks = log-sink1
agnetの完全なプロファイルには、a,Sources,sources type b,Sinks,sinks type c,Channel,Channel type d,Channelを使用してSourcesとSinksを直列に接続する内容が必要です.confファイルで説明しますが、このプロファイルは実際には次の順序を調整する必要があります.まずsources、slinks、channelsを定義します.flume-ng agentの名前はagent 1で、その後agentプログラム-nを起動した後の名前と一致します.agent1.channels=ch 1#channels名ch 1 agent 1.sources=avro-source 1#sources名称avro-source 1名前は文生義を望むことができて、悪くありません:)agent 1.sinks=log-sinke 1#sinks名前はlog-sink 1—————————私は分割線———————————————
sourcesセクション定義agent 1.sources.avro-source1.channels=ch 1#agent名.sources.sources名使用するchannels agent 1.sources.avro-source1.type=avro#は前の最後の点と同じです.タイプavro agent 1.sources.avro-source1.bind=0.0.0.0#最後の点.bindバインドアドレスagent 1.sources.avro-source1.port=41414#最後のポイント.port指定ポート—————————私は分割線—————————
チャンネル部分定義:agent 1.channels.ch1.type=memory#agent名.channels.チャンネル名使用するタイプ—————————私は分割線—————————agent 1.sinks.log-sink1.channel=ch 1#agent名.sinks.sinks名どのチャンネルからevents agent 1を収集しますか.sinks.log-sink1.type=logger#最後の点.type sinksタイプ.——————————————————————————————テストを開始します.まずクライアントを開きます.
# flume-ng agent -n agent1 -c /opt/apps/flume-ng/conf/ -f flume.conf  &
#名前agent 1がプロファイル定義と一致することに注意してください.avro-clientクライアント読み取り/etc/passworsファイルを開くには、次の手順に従います.
# flume-ng avro-client -c /opt/apps/flume-ng/conf/ -H localhost -p 41414 -F /etc/passwd
#avro-client読み取り/etc/passwdを開始した後、プロセスは終了します.私たちのテスト状況を検証してflumeを表示します.log詳細は添付ファイルflume_を参照log01.txt