首页 > 代码库 > flume发送与接受日志

flume发送与接受日志

apache-flume-1.5.0.1-bin.tar.gz日志接收端1.修改配置文件cp flume-conf.properties.template flume-conf.propertiesvim flume-conf.propertiescollector1.sources = AvroIncollector1.sources.AvroIn.type = avrocollector1.sources.AvroIn.bind = 0.0.0.0collector1.sources.AvroIn.port = 4545collector1.sources.AvroIn.channels = mc1collector1.channels = mc1collector1.channels.mc1.type = memorycollector1.channels.mc1.capacity = 100collector1.sinks = LocalOutcollector1.sinks.LocalOut.type = file_rollcollector1.sinks.LocalOut.sink.directory = /var/log/flume/collector1collector1.sinks.LocalOut.sink.rollInterval = 0collector1.sinks.LocalOut.channel = mc1cp flume-env.sh.template  flume-env.shvim flume-env.sh修改JAVA_HOME2.运行bin/flume-ng agent -c conf -f conf/flume-conf.properties -n collector1日志发送端1.修改配置文件cp flume-conf.properties.template flume-conf.propertiesvim flume-conf.propertiesagent1.sources = ngrinderagent1.sources.ngrinder.type = exec agent1.sources.ngrinder.command = tail -F /var/log/apache2/access.logagent1.sources.ngrinder.channels = mc1agent1.channels = mc1agent1.channels.mc1.type = memoryagent1.channels.mc1.capacity = 100agent1.sinks = avro-sinkagent1.sinks.avro-sink.type = avroagent1.sinks.avro-sink.channel = mc1agent1.sinks.avro-sink.hostname = 192.168.0.111agent1.sinks.avro-sink.port = 4545#缓存日志断点续传agent1.channels.memory4log.type = memory agent1.channels.memory4log.capacity = 1000 agent1.channels.memory4log.transactionCapacity = 100cp flume-env.sh.template  flume-env.shvim flume-env.sh修改JAVA_HOME2.执行bin/flume-ng agent -c conf -f conf/flume-conf.properties -n agent13.注意/var/log/flume/collector1/ 要写入权限/var/log/apache2/access.log  要读取权限

 

flume发送与接受日志