`
文章列表
   本文主要介绍了zookeeper启动的过程      运行zkServer.sh start命令可以启动zookeeper。入口的main函数在类中QuorumPeerMain。    main函数主要调用了runFromConfig函数,创建了QuorumPeer对象,并且调用了start函数,从而启动了zookeeper。 public class QuorumPeerMain { protected QuorumPeer quorumPeer; /** * To start the replicated server specify t ...
Sink 将从channel接收event,然后将event发往目标地址。    /** * * A simple sink which reads events from a channel and writes them to HBase. * This Sink uses an aysnchronous API internally and is likely to * perform better. * The Hbase configution is picked up from the first <tt>hbase-site.xml</tt> ...
flume包括三种sink processor,DefaultSinkProcessor,FailoverSinkProcessor,LoadBalancingSinkProcessor   Default sink processor that only accepts a single sink, passing on process results without any additional handling. Suitable for all sinks that aren't assigned to a group. public class DefaultSinkProce ...
flume自带两种channelSelector。一种是MultiplexingChannelSelector,另一种是ReplicatingChannelSelector。   ReplicatingChannelSelector是将event发送到每个channel public class ReplicatingChannelSelector extends AbstractChannelSelector { private final List<Channel> emptyList = Collections.emptyList(); @Overr ...
Channel 相当于一个管道,source写数据到channel中,sink从channel取数据。Channel有三类,memory,file,jdbc。memory速度最快,但是当机器宕机的时候数据会丢失,file数据不会丢失,jdbc速度最慢,一般选择fileChannel。    Source 中会调用ChannelProcessor的processEvent方法处理Log事件。对于每个channel都会获得一个Transaction,  然后调用tx.begin方法,put event 到channel,然后调用commit.如果有异常,调用transactoin的roll ...
flume的source用于收集日志,父类为AbstractSource,下图中的其他类都继承于AbstractSource     AvroSource    lifecycleAware 会调用start方法启动avroSource。avroSource主要启动了一个NettyServer用于接收数据,然后交由avroSource处理。 @Override public void start() { logger.info("Starting {}...", this); //when receive data, AvroSou ...

flume源码分析

 
flume是一个高可靠性的分布式的大文件收集系统。它提供了transaction来保证数据不会丢失。 flume官网:http://flume.apache.org/ Flume文档:http://flume.apache.org/FlumeUserGuide.html,http://flume.apache.org/FlumeDeveloperGuide.html   安装:从官网下载flume,然后解压 启动:nohup bin/flume-ng agent --conf <conf_file_path> --conf-file <conf_file> ...

Zookeeper 学习

现在有事件可以学习一下zookeeper。 link:http://www.blogjava.net/BucketLi/archive/2010/12/21/341268.html 这个链接主要讲了zookeeper的安装部署以及zookeeper的应用场景,zookeeper中znood的管理。   zookeeper的应用场景有:1.  配置信息的管理和同步(spark中用zookeeper来管理work,excutor,deriver的信息)                                          2. node状态的管理(spark中用zookeep ...
We can refer to the link http://spark.incubator.apache.org/docs/latest/tuning.html  for  detail tuning document.        After tuning, spark can process 200M logs every minutes  in one single work with 1G memory. The time for finish process logs is about 35-40 seconds every duration.      There i ...
明天写
BlockManager主要在deriver和excutor构造。在deriver构造了一个BlockManagerMasterActor对象,主要负责收集block的info。在executor创建了BlockManagerMasterActor的ref,并且将ref封装到BlockManagerMaster中用于与BlockManagerMasterActor的通信。BlockManager封装了BlockManagerMaster,用于存储block,并调用BlockManagerMaster与master通信。   //BlockManagerMasterActor 处理的消息。 ...
Spark很重要的一部分是Task的schedual,以下是具体的流程图。  SchedulableBuilder分为两种,分别是FairSchedulableBuilder和FIFOSchedulableBuilder。主要是pool的getSortedTaskSetQueue方法中调用不同的taskSetSchedulingAlgorithm去排序schedulableQueue override def getSortedTaskSetQueue(): ArrayBuffer[TaskSetManager] = { var sortedTaskSetQueue = ne ...
Excutor主要分为两部分,一是ExecutorBackend,二是Executor。ExecutorBackend用来接收信息,调用Executor执行task。我们以CoarseGrainedExecutorBackend为例介绍Excutor。 worker会调用java命令启动CoarseGrainedExecutorBackend。在run函数中创建了CoarseGrainedExecutorBackend和WorkerWatcher两个actor。WorkerWatcher用来监控worker的状态。 def main(args: Array[String]) { ...
spark中很重要的一点就是task具体分配到哪个excutor上执行,如果分配不合理,将会消耗很多额外的资源。例如:executor1用flume receiver接收到数据,并将数据保存到block1上,excutor2用flume receiver接收到数据,并将数据保存到block2上。RDD将有两个patition,将对应产生两个task. task1处理block1,task2处理block2.如果将 task1分配到excutor2上去处理,那么excutor2将需要从excutor1上拿到block1,然后再计算,这样就加重 了数据传输的消耗。那么spark是如何来选择的呢? ...
spark用metrics-core这个jar包来做spark 各个部件metrics的管理 Metrics.properties.template文件是用来配置metrics的,metrics的配置分为两部分,一是source,二是sink。有些类似于flume的source和sink的概念。Source用来收集work,master,deriver,executor等的信息。Source有ApplicationSource,BlockManagerSource,DAGSchedulerSource,ExecutorSource,JvmSource,MasterSource,Worker ...
Global site tag (gtag.js) - Google Analytics