将机器hadoop中 flume 配置文件重命名为 flume-master ; 并修改里面内容为
agent.sources = source1
agent.channels = memoryChannel
agent.sinks = sink1
agent.sources.source1.type = spooldir
agent.sources.source1.spoolDir=/root/hmbbs
agent.sources.source1.channels = memoryChannel
# Each sink's type must be defined
#Specify the channel the sink should use
# Each channel's type is defined.
agent.channels.memoryChannel.type = memory
# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.memoryChannel.capacity = 1000
agent.channels.memoryChannel.keep-alive = 1000
agent.channels.memoryChannel.type=file
agent.sinks.sink1.type = avro
agent.sinks.sink1.hostname = hadoop1
agent.sinks.sink1.port = 23004
agent.sinks.sink1.channel = memoryChannel
将机器hadoop1中 flume 配置文件重命名为 flume-node ; 并修改里面内容为
agent.sources = source1
agent.channels = memoryChannel
agent.sinks = sink1
# For each one of the sources, the type is defined
agent.sources.source1.type = avro
agent.sources.source1.bind = hadoop1
agent.sources.source1.port = 23004
agent.sources.source1.channels = memoryChannel
# Each sink's type must be defined
#agent.sinks.loggerSink.channel = memoryChannel
# Each channel's type is defined.
agent.channels.memoryChannel.type = memory
# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.memoryChannel.capacity = 100
agent.channels.memoryChannel.keep-alive = 100
agent.sinks.sink1.type=hdfs
agent.sinks.sink1.hdfs.path=hdfs://hadoop:9000/hmbbs/%y-%m-%d/%H%M%S
agent.sinks.sink1.hdfs.fileType=DataStream
agent.sinks.sink1.hdfs.writeFormat=TEXT
agent.sinks.sink1.hdfs.round=true
agent.sinks.sink1.hdfs.roundValue=5
agent.sinks.sink1.hdfs.roundUnit=minute
#agent.sinks.sink1.hdfs.rollInterval=1
agent.sinks.sink1.hdfs.useLocalTimeStamp=true
agent.sinks.sink1.channel = memoryChannel
agent.sinks.sink1.hdfs.filePrefix=events-
agent.sources = source1
agent.channels = memoryChannel
agent.sinks = sink1
agent.sources.source1.type = spooldir
agent.sources.source1.spoolDir=/root/hmbbs
agent.sources.source1.channels = memoryChannel
# Each sink's type must be defined
#Specify the channel the sink should use
# Each channel's type is defined.
agent.channels.memoryChannel.type = memory
# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.memoryChannel.capacity = 1000
agent.channels.memoryChannel.keep-alive = 1000
agent.channels.memoryChannel.type=file
agent.sinks.sink1.type = avro
agent.sinks.sink1.hostname = hadoop1
agent.sinks.sink1.port = 23004
agent.sinks.sink1.channel = memoryChannel