Hadoop中的HDFS学习总结

Hadoop学习总结-上篇(HDFS、MapReduce) 跟学尚硅谷Hadoop3.x, 1 入门 1.1 优势与组成(面试重点) HDFS-Hadoop Distributed File System,一个分布式文件系统 NameNode(nn);DataNode(dn);Secondary NameNode(2nn) YARN-Yet Another Resource Negotiator ,另一种资源协调者,是 Hadoop 的资源管理器 MapReduce -Map 阶段并行处理输入数据; Reduce 阶段对 .. 阅读详情

博主自己学习hdfs的一些笔记,整理了一下(有什么不懂的可以问我。尽量解答,希望对大家有帮助)

Hadoop组成

Hadoop HDFS:一个高可靠、高吞吐量的分布式文件系统,对海量数据的存储。
Hadoop MapReduce:一个分布式的资源调度和离线并行计算框架。
Hadoop Yarn:基于HDFS,用于作业调度和集群资源管理的框架。
Hadoop Common:Hadoop工具包,支持其他模块的工具模块(Configuration、RPC、序列化机制、日志操作)

hadoop 的组成部分

  1. List item

HDFS 分布式文件存储系统
管理者:NameNode
工作者:DataNode
辅助者:SecondayNameNode
MapReduce 分布式离线计算框架
Yarn Hadoop资源调度器
管理者:ResourceManager
工作者:NodeManager

HDFS数据副本机制

1、第一份数据来源于用户的客户端
2、第二份数据存放在与第一份副本在同一个机架,不同的节点,按照一定的机制(cpu 内存 io 使用率和节点磁盘剩
余容量)选取一个节点进行存放
3、第三份副本存放在,与第一第二副本不在同一机架,且逻辑距离最近的机架上,按照一定的机制(cpu 内存 io 使
用率和节点磁盘剩余容量),选择一个节点进行存放
在这里插入图片描述
hadoop 视硬件设备经常损坏为常态,为了防止硬件损坏导致系统不可用,所
以构建多副本机制。

Namenode作用

对存放的元数据,名字空间,目录树进行管理维护
监控datanode的心跳信息
确定指定文件到datanode的映射关系
 响应客户端的所有请求  
客户端和dataname交流之间的桥梁

DataNode作用

响应客户端的读写操作
周期性的向namenode发送自己的心跳信息,namenode 如果10分钟没有接受到该节点的心跳报告,认为该节点lost
数据的流水线复制(一点一点的复制)
以 block的形式存储在hdfs中

机架感知

是一个脚本,记录着主机ip与交换机之前的对应关系
.告诉hadoop集群那台机器属于那台机架
NameNode分配节点的时候,会用到机架感知

HDFS文件读写流程(博主前面写了一篇,点超链接吧)

读写流程

HDFS数据完整性计算(保证数据的完整性)

在这里插入图片描述
数据写入之后进行数据首次校验,文件系统周期性进行校验,防止数据丢失。
读取数据之前进行数据校验,若两个校验相同,那么表示数据没有丢失,开始读取数据。
若两个校验不相同,那么表示数据有部分丢失,换到其他节点(相同副本的节点)读取数据

HDFS的shell命令操作</

大数据Hadoop教程-学习笔记02【Apache Hadoop、HDFS】 阅读详情

相关推荐

鲸鱼优化算法(WOA)与门控循环单元(GRU)结合的预测模型(WOA-GRU)及其Python和MATLAB实现

Python和MATLAB的实现均突出模型结构和优化过程。2. **全局搜索与局部搜索结合**:WOA在寻优时,既有全局搜索的能力,又具备局部精准搜索的能力,能有效避免陷入局部最优解。2. **简化结构**:与长短期记忆(LSTM)相比,GRU的结构更为简化,避免了多层细胞结构,提高了计算效率。4. **使用WOA进行优化**:通过WOA迭代优化GRU模型中的参数,如学习率、批量大小和GRU单元的权重。3. **良好的表现**:GRU在多个时序数据序列的预测任务中表现优异,特别是在较短的数据序列中。

qq_45441438的博客 1327

高德地图可视化入门:零基础用Python+高德API打造你的第一个热力图

本文详细介绍了如何使用Python和高德地图API从零构建商业级热力图。通过环境配置、地理编码、数据清洗到最终可视化展示的全流程指南,帮助开发者快速掌握地图可视化技术,特别适合展示商圈人流、疫情热点等地理分布数据。

weixin_29053067的博客 313

Stata面板数据OLS回归分析实战指南

OLS回归作为计量经济学的核心分析方法,通过最小化残差平方和实现参数估计,广泛应用于经济学实证研究。其技术价值在于模型简洁、结果易于解释,特别适合处理面板数据中的复杂关系。在实际应用中,配合robust标准误能有效解决异方差问题,而固定效应模型则可控制个体特异性。本文以Stata软件为例,详细演示从数据导入、描述性统计到混合OLS和固定效应模型构建的全流程,重点解析面板数据特有的格式设定、模型选择标准以及结果呈现技巧,为经济学研究者提供可直接复用的分析框架。

weixin_29051811的博客 271

Profinet从站开发初体验:用p-net开源库和树莓派快速搭建一个IO设备模拟器

本文详细介绍了如何使用p-net开源库和树莓派快速搭建Profinet从站IO设备模拟器。从开发环境准备、p-net源码编译到设备模拟器功能实现,提供了全流程实战指南,帮助开发者快速掌握工业通信协议开发技巧,适用于工业自动化领域的设备互联测试与验证。

weixin_30384217的博客 384

深入了解BPM及BPM业务流程管理系统

BPM 即业务流程管理,是一种以规范化的构造端到端的卓越业务流程为中心,以持续地提高组织业务绩效为目的的系统化方法。它涵盖了业务流程的整个生命周期,包括流程的设计、执行、监控、分析和优化。BPM 作为一种先进的管理方法,对于企业提高运营效率、降低成本、提升客户满意度和增强竞争力具有重要意义。BPM 流程管理系统为企业实现 BPM 提供了强大的工具和支持,而 F2BPM 流程管理平台以其先进的技术架构、丰富的功能模块、简单易用的操作界面和强大的定制能力,成为企业实现业务流程管理的理想选择。

Stone3625的博客 2956

Python爬虫实战:利用最新技术爬取抖音话题挑战视频

本文将详细介绍如何使用Python最新技术栈构建一个高效的抖音话题挑战视频爬虫。我们将从环境配置开始,逐步讲解请求模拟、数据解析、反反爬策略、数据存储等关键环节,并提供完整的代码实现。本文适合有一定Python基础的开发者学习高级网络爬虫技术。关键词:Python爬虫、抖音API、话题挑战、视频爬取、反反爬本文详细介绍了如何使用Python最新技术栈构建抖音话题挑战视频爬虫。我们从基础请求开始,逐步实现了数据解析、反反爬策略、数据存储等核心功能,并探讨了分布式和增量爬取等高级主题。更智能的反反爬策略。

2201_76125261的博客 1747

基于Python的异步爬虫实战:高效抓取同花顺概念板块数据

本文将详细介绍如何使用Python最新异步爬虫技术(requests-html+aiohttp+selenium)高效抓取同花顺概念板块数据。内容涵盖:反爬机制破解、动态页面渲染处理、数据解析存储等完整流程,并提供可复用的高性能爬虫代码实现。高性能:异步并发处理,QPS可达50+高可用:完善的异常处理机制可扩展:支持分布式部署增加历史数据回溯功能集成机器学习识别验证码构建实时数据推送系统。

2201_76125261的博客 1541

使用 MATLAB/Simulink 构建一个 基于神经网络控制的单相并网逆变器系统

单相并网逆变器广泛应用于户用光伏小型储能和电动汽车V2G等场景。其核心控制目标是实现高质量的并网电流,即电流与电网电压同频同相(单位功率因数),且总谐波畸变率 (THD)极低。非线性因素:电力电子器件的开关死区非线性电感寄生参数。参数不确定性:滤波器元件(L, C)的老化温漂。电网扰动:电压谐波频率波动不平衡。模型依赖性:PI、PR等控制依赖于精确的系统模型,模型失配导致性能下降。动态响应:在光照突变(光伏)或负载突变(储能)下,需快速、无超调地响应。

xiaoheshang_123的博客 276

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

深度学习工具包 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")

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

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

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

上一篇: SecondaryNameNode工作原理
下一篇: Hadoop中新增节点
胡子球手
博客等级 码龄8年 30粉丝 86原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址