- 编写配置文件
# 配置Agent a1的组件
a1.sources=source1
a1.channels=channel1
a1.sinks=sink1
# 描述/配置a1的source1
a1.sources.source1.type=exec
#具体执行的命令
a1.sources.source1.command=ping www.baidu.com
# 描述/配置a1的channel1
a1.channels.channel1.type=memory
# 描述/配置a1的sink1
a1.sinks.sink1.type=logger
# 绑定
a1.sources.source1.channels=channel1
a1.sinks.sink1.channel=channel1
- 启动服务端命令:
./bin/flume-ng agent -n a1 -c ./conf/ -f ./job/exec.template.conf -Dflume.root.INFO,console