Hadoop实战之四~hadoop作业调度详解(2)

Habitat-baselines v0.1.7防踩坑手把手带你跑通(全网唯一) 阅读详情

这篇文章将接着上一篇wordcount的例子,抽象出最简单的过程,一探MapReduce的运算过程中,其系统调度到底是如何运作的。

%26nbsp;

情况一:数据和运算分开的情况

  wordcount这个例子的是hadoop的helloworld程序,作用就是统计每个单词出现的次数而已。其过程是:

现在我用文字再来描述下这个过程。

1  Client提交一个作业,将Mapreduce程序和数据到HDFS中

2  发起作业,Hadoop根据各机器空闲情况,调度一台(或者N台taskTracker机器,进行Map运算)

3  taskTacker机器将程序和数据拷贝到自己机器上。

4  taskTacker机器启动jvm,进行Map运算

5  taskTacker机器运算完成,将数据存储在本机上,并通知JobTacker节点。

6  JobTacker等待所有机器完成,调度一台空闲的机器,进行Reduce运算,并告知数据存储所在机器。

7  进行Reduce运算的TaskTacker将数据通过RPC拷贝到自己机器上,同时将程序从HDFS中拷贝到自己机器中。

8  启动JVM,加载程序,进行Reduce运算。

9%26nbsp;  运算完成,reduce运算的机器将数据存储在HDFS中,并通知JobTacker。

10 JobTacker发现任务完成,通知客户端,你的事干完了。

11 %26nbsp; 客户端通过访问HDFS,拿到最终运算数据。

为什么Map中间数据会存储本机上而不是HDFS上呢,原因是因为中间的运算可能会失败,如果失败了也没有必要存储在HDFS上,JobTacker会选择另外一台机器完成任务即可。只有最终数据才是有价值的。

情况二:数据和节点在一起的情况

%26nbsp;真实的情况当然不是情况一,原因是因为: 移动运算比移动数据更经济. 在Hadoop中,往往同一台机器既是DataNode,也是TaskTraker。Hadoop在调度过程中,会优先调度数据所在的机器进行运算,这样数据就不会在机器之间Copy来Copy去,网络带宽就不会成为运算的瓶颈了。这个例子的示意图如下:

%26nbsp;

这张图结合上面的描述,我相信大家应该很容易就看懂了。那既然Hadoop的实际过程是情况二,我为什么要先描述情况一呢?原因有两点:

1  情况一更容易理解。

2  情况一更容易实现。

%26nbsp;

如何根据Hadoop的调度原理,写自己的的集群调度框架,这是我最近在思索和践行的一个事情,有兴趣的同学其实也可以自己写一个,大家多多交流~

3D点云处理:PointNet++与PointTransformer的对比 摘要: 3D点云处理中,PointNet++和PointTransformer是两种主流深度学习模型。PointNet++通过分层采样和分组策略提取局部特征,而PointTransformer利用自注意力机制捕捉全局上下文。实验表明,PointTransformer在分类(ModelNet40准确率92.1%)和分割(ShapeNet mIoU 85.7%)任务上性能更优,但计算开销较大(训练时间180秒/轮)。PointNet++在实时性场景更具优势(训练时间120秒/轮)。未来可结合两者优势,或优化Tr 阅读详情

相关推荐

数据分析——员工离职预测

员工离职预测一. 题目描述二. 数据说明三. 步骤实现1.导入并查看2.数据探索性分析3.数据处理4.模型分析5.结果分析(1) 可视化的结果分析(2)特征选择结果分析(3)多模型交叉验证结果分析 一. 题目描述 员工是否准备离职是困扰用人单位的问题,其关系到单位业务的开展及新人员的招聘,及时的分析出有离职倾向的员工成为关键的因素。数据主要包括影响员工离职的各种因素(工资、出差、工作环境满意度、工作投入度、是否加班、是否升职、工资提升比例等)以及员工是否已经离职的对应记录。 二. 数据说明 数据分为训练数据

weixin_43925467的博客 1万+

别再折腾Ubuntu 18.04了!给Win11新电脑装双系统,我为什么推荐你直接上20.04?

本文详细分析了在Win11新电脑上安装Ubuntu双系统时,为何推荐选择20.04而非18.04版本。从硬件兼容性、安装流程优化、长期维护周期、开发环境适配性等多个维度进行对比,揭示20.04在现代PC硬件支持上的显著优势,包括更好的NVMe固态硬盘支持、Intel 12代CPU调度优化等,为开发者提供更稳定高效的双系统解决方案。

weixin_30338497的博客 504

Doris + Iceberg 实现高效数据湖分层:架构解析与最佳实践

本文深入解析了如何利用Doris与Iceberg构建高效的数据湖冷热分层架构。通过将高频访问的热数据存储在Doris中以实现毫秒级查询,同时将历史冷数据归档至低成本的Iceberg存储,该方案在保障查询性能的同时显著降低了总体拥有成本。文章详细阐述了从架构设计、自动化迁移到统一查询的最佳实践,为应对海量数据下的成本与性能平衡提供了实战指南。

weixin_29207533的博客 136

Hadoop实战之workcount

两种方法实现workcount

Kayleigh520的博客 1211

R语言实战:5分钟搞定GEO单细胞数据(scRNA-seq)下载与整理(附完整代码)

本文详细介绍了如何使用R语言快速下载和整理GEO单细胞数据(scRNA-seq),提供完整的自动化处理代码。从环境准备、数据获取到文件整理和质量检查,涵盖10X Genomics标准格式及非标准数据的处理技巧,帮助生物信息学研究者高效完成数据预处理工作。

weixin_29054399的博客 609

图像修复黑科技:对比BM3D/DnCNN等5种去噪器在PNP框架中的实战效果

本文深度评测了BM3D、DnCNN等五款主流去噪器在即插即用(PnP)优化框架中的实战表现。通过量化指标、视觉对比及超分等泛化任务测试,揭示了深度学习模型在性能与收敛速度上的优势,并为不同应用场景提供了选型指南与工程化建议。

weixin_29065959的博客 371

JobTracker实现原理(一)

首先进行JobTacker内部实现原理的解析。

kakayang2012的博客 1880

手把手教你接入京东购物小程序:从领券到下单的全流程解析

本文详细解析了如何从API申请到领券下单,手把手教你接入京东购物小程序的全流程。涵盖京东联盟账号注册、商品信息获取、优惠券链接转换等关键技术实践,帮助开发者高效实现电商功能集成,提升用户购物体验。

g5h6i的博客 912

MapReduce 简单概述操作

MapReduce 简单概述 MapReduce 的定义 MR 是一个分布式程序计算框架,基于 Hadoop 的数据分析应用核心框架。、 MR 核心功能:将用户编写的业务逻辑代码和自带的默认组件整合成一个完整的分布式计算程序,并发运行在 Hadoop 集群上。 MapReduce 的优缺点 1、优点: MR 易于编程 有良好的扩展性 有很高的容错性 适合做 PB 级以上海量数据的离线处理 2、缺点: 不擅长实时计算 不擅长流式计算 不擅长 DAG (有向图...

weixin_42209449的博客 1619

EMC系列EtherCAT总线运动控制器(二):Motion通讯连接、总线配置及诊断

雷赛-EMC系列EtherCAT总线运动控制器(二):Motion通讯连接、总线配置及诊断

weixin_38570076的博客 1890

美军利用MANET技术实现无人作战单元协同作战

本文首先介绍了移动自组织网络 (MANET)以及Wave Relay®波形中继技术,并探讨了波形中继MANET平台在美空军ABMS项目等军事方面的运用情况。

guanyifu9的博客 858

Hadoop之 MapReduce (Yarn资源调度器)

文章目录四、Yarn资源调度器4.1 Yarn基本架构4.2 Yarn工作机制4.3 作业提交全过程4.4 资源调度器4.5 容量调度器多队列提交案例4.5.1 需求4.5.2 配置多队列的容量调度器4.5.3 向Hive队列提交任务 四、Yarn资源调度器 4.1 Yarn基本架构 Yarn是一个资源调度平台,负责为运算程序提供服务器运算资源,相当于一个分布式的操作系统平台,而 MapReduce 等运算程序则相当于运行于操作系统之上的应用程序。 4.2 Yarn工作机制 (1)MR程序提交到客户

weixin_48067943的博客 902

功能安全实战系列12-英飞凌TC3xx锁步核及其自检开发

本文介绍了英飞凌Tricore系列芯片的锁步核(Lockstep Core)功能及其故障注入自检机制。锁步核通过主核和检查核同步执行指令,并比较输出结果来检测硬件故障。文章详细阐述了锁步核的工作原理、使能配置方法以及故障注入自检的实现过程。故障注入测试通过专用寄存器LCLTEST触发,系统会定期自动测试比较器节点,验证锁步核的故障检测能力。当检测到异常时,会触发SMU模块的警报机制。该技术为汽车电子系统提供了重要的功能安全保障。

initiallizer的博客 923

Linux部署hadoop2

Java设置;创建hadoop要用到的文件夹;hadoop设置;格式化hdfs;启动hadoop;验证hadoop;接下来就逐步开始吧;

2401_86400130的博客 1128

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Hadoop-Windows下HDFS客户端环境搭建,Eclipse连接HDFS的心酸历程(内附winutils.exe(hadoop-2.6.5~hadoop-3.2.1))

Hadoop-Windows下HDFS客户端环境搭建,Eclipse连接HDFS的心酸历程(内附winutils.exe(hadoop-2.6.5~hadoop-3.2.1))

H_X_P_的博客 1912

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

Hadoop安装最后一步~Hadoop伪分布式配置

□ Hadoop 可以。

Coder-coco的博客 304

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Hadoop实战之一~Hadoop概述

Hadoop概述  Hadoop是一个开源分布式云计算平台,基于Map/Reduce模型的,处理海量数据的离线分析工具。基于Java开发,建立在HDFS上,最早由Google提出,有兴趣的同学可以从Google三驾马车: GFS,mapreduce,Bigtable开始了解起,这里我不详细介绍了,因为网上的资料实在是太多了。 Hadoop项目的结构如下:   Hadoop中

浩子的博客 471

Linux部署hadoop2.7.7集群

在CentOS7环境下,hadoop2.7.7集群部署的实战

程序员欣宸的博客 7096
上一篇: [译]Stairway to Integration Services Level 4 - 更新数据
下一篇: jquery formValidate demo 采用struts 异步方式检验用户名是否存在
lin91o7c
博客等级 码龄12年 1粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值