Flume 讀取JMS 訊息佇列訊息,並將訊息寫入HDFS

來源:互聯網
上載者:User

標籤:type   配置   esc   ast   interface   nts   nfa   利用   init   

利用Apache Flume 讀取JMS 訊息佇列訊息。並將訊息寫入HDFS,flume agent配置例如以下:

flume-agent.conf

  #name the  components on this agent
  agentHdfs.sources  = jms_source
  agentHdfs.sinks =  hdfs_sink
  agentHdfs.channels  = mem_channel


  #  Describe/configure the source

 agentHdfs.sources.jms_source.type  = jms
# Bind to all interfaces
agentHdfs.sources.jms_source.initialContextFactory = org.apache.activemq.jndi.ActiveMQInitialContextFactory
agentHdfs.sources.jms_source.connectionFactory = ConnectionFactory
agentHdfs.sources.jms_source.destinationName = BUSINESS_DATA  #AMQ queue
agentHdfs.sources.jms_source.providerURL = tcp://hadoop-master:61616
agentHdfs.sources.jms_source.destinationType = QUEUE



# Describe  the sink
agentHdfs.sinks.hdfs_sink.type = hdfs
agentHdfs.sinks.hdfs_sink.hdfs.path hdfs://hadoop-master/data/flume/%Y-%m-%d/%H
agentHdfs.sinks.hdfs_sink.hdfs.filePrefix = %{hostname}/events-
agentHdfs.sinks.hdfs_sink.hdfs.maxOpenFiles = 5000
agentHdfs.sinks.hdfs_sink.hdfs.batchSize= 500
agentHdfs.sinks.hdfs_sink.hdfs.fileType = DataStream
agentHdfs.sinks.hdfs_sink.hdfs.writeFormat =Text
agentHdfs.sinks.hdfs_sink.hdfs.rollSize = 0
agentHdfs.sinks.hdfs_sink.hdfs.rollCount = 1000000
agentHdfs.sinks.hdfs_sink.hdfs.rollInterval = 600
agentHdfs.sinks.hdfs_sink.hdfs.useLocalTimeStamp = true



# Use a  channel which buffers events in memory

agentHdfs.channels.mem_channel.type  = memory
agentHdfs.channels.mem_channel.capacity  = 1000
agentHdfs.channels.mem_channel.transactionCapacity  = 100

# Bind the  source and sink to the channel
agentHdfs.sources.jms_source.channels  = mem_channel
agentHdfs.sinks.hdfs_sink.channel  = mem_channel

Flume 讀取JMS 訊息佇列訊息,並將訊息寫入HDFS

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.