One spark receiver or multiple spark receiver receives multiple flume agents

Source: Internet
Author: User

    1. Receive multiple flume agents with one spark receiver
StringHost = args[0];intPort = Integer.parseint (args[1]);StringHost1 = args[2];intPort1 = Integer.parseint (args[3]); Inetsocketaddress Address1 =NewInetsocketaddress (Host,port); Inetsocketaddress Address2 =NewInetsocketaddress (HOST1,PORT1); Inetsocketaddress[] Inetsocketaddressarray = {ADDRESS1,ADDRESS2}; Javastreamingcontext JSSC =NewJavastreamingcontext (NewSparkconf (). Setappname ("Javaflumeeventhandle_1"), Durations.seconds (2)); javareceiverinputdstream<sparkflumeevent> Flumestream = Flumeutils.createpollingstream (JSSC, Inetsocketaddressarray, storagelevel.memory_and_disk_ser_2 ());
    1. 2 Spark Receiver receives multiple flume agents
String host = args[0];intPort = Integer.parseint (args[1]); String host1 = args[2];intPort1 = Integer.parseint (args[3]); Inetsocketaddress Address1 =NewInetsocketaddress (Host,port); Inetsocketaddress Address2 =NewInetsocketaddress (HOST1,PORT1);      Inetsocketaddress[] Inetsocketaddressarray = {ADDRESS1,ADDRESS2}; Javastreamingcontext JSSC =NewJavastreamingcontext (NewSparkconf (). Setappname ("Javaflumeeventhandle_1"), Durations.seconds (2));//Javareceiverinputdstream<sparkflumeevent> Flumestream = Flumeutils.createpollingstream (JSSC, InetSocke Taddressarray, storagelevel.memory_and_disk_ser_2 ());javareceiverinputdstream<sparkflumeevent> Flumestream = Flumeutils.createpollingstream (Jssc,host,port);        javareceiverinputdstream<sparkflumeevent> flumeStream1 = Flumeutils.createpollingstream (JSSC, host1, Port1); Javadstream<sparkflumeevent>Union= Flumestream.Union(FLUMESTREAM1);

Performance reference:
Http://blog.sina.com.cn/s/blog_13122bdbc0102vay7.html

One spark receiver or multiple spark receiver receives multiple flume agents

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.