您现在的位置是:热点 >>正文
Hadoop,大数据离不开它
热点550630人已围观
简介...
搭建数仓,hadoop虽然有点落伍,但还是不可或缺的。本文描述下单机版的hadoop运作机制。
HDFS是Google GFS的开源实现,是一个分布式文件系统,是大数据技术的基石,直接上架构图:
主要包含Namenode和Datanodes,MapReduce主要就是在Datanodes进行并行计算。
core-site.xml:
fs.defaultFS Ha; hdfs://localhost:8001 hadoop.tmp.dir /root/hadoop-3.2.2/tmp
其中8001端口就代表hdfs的根路径,另外hdfs-site.xml配置参数也非常多。
比如dfs.repdolication表示hdfs副本集,单机版就设置1;dfs.namenode.http-address是NameNode web管理地址,可以查看hdfs的一些情况;dfs.datanode.address是DataNode的端口;dfs.namenode.name.dir和dfs.namenode.data.dir表示Namenode和Datanodes的存储目录,默认继承于hadoop.tmp.dir值。
如果修改目录相关的参数,需要op格式化hdfs:
$ bin/hdfs namenode -format
经验就是建议删除dfs.namenode.data.dir下的文件,再格式化。
一旦hdfs可用,操作它们就像操作本地文件一样:
#创建登陆用户的根目录,有了根目录,则不需要指定hdfs://前缀 $ ./bin/hdfs dfs -mkdir -p &nb,大sp;"hdfs://localhost:8001/user/root" $ ./bin/hdfs dfs -mkdir -p test2 $ ./bin/hdfs dfs -put ~/test.log hdfs://localhost:8001/test $&nbs数据p;./bin/hdfs dfs -put ~/test.log test2 $ ./bin/hdfs dfs -ls test2 $ ./bin/hdfs dfs -cat test2/test.log
接下去说说MapReduce,主要包含map和reduce离不过程,另外不能忘记shuffle,map相对于从hdfs dataNodes处理数据,然后shuffle将相关联的数据交给reduce进行处理。
运行MapReduce过程很简单:
$ bin/hdfs dfs -mkdir input $ bin/hdfs dfs -put etc/hadoop/*.xml input #&nbs开它p;将mapreduce任务执行的结果放入 hdfs output 目录中 $ bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.2.jar grep input output 'dfs[a-z.]+' bin/hdHafs dfs -cat output/*
早期的MapReduce即包含计算框架,又包含调度框架,比较臃肿,比如想在当前集群运行另外一种计算任务,就不方便了,所以后来从MapReduce中将调度框架抽取出来,命名为Yarn,这样不管是MapReduce还是Spark只要符合Yarn接口定义,就能被Yarn调度,MR和Spark专做做分布式运算,相当于解耦了。
Yarn的架构图如下:
主要包括RdoesourceManager和NodeManager,另外为了分布式运算NodeManager一般和HDFS的DataNodes运行在一起。
ResourceManager主要包含Scheduler和ApplicationsManager。
修改yarn-site.xml:
yarn.nodemanager.aux-services &nopbsp;mapreduce_shuffle yarn.resourcemanager.webapp.address 0.0.0.0:7088
其中,mapreduce_shuffle表示调度MapReduce任务,7088 是Yarn的Web管理地址;当然Y,大arn还有很多的参数。
修改 mapred-site.xml:
mapreduce.framework.name yarn
mapreduce.framework.name的值yarn表示MapReduce使用Yarn调度。
然后执行yarn调度:
$ bin/yarn jar 数据;./share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.2.jar grep input output 'dfs[a-z.]+'
只是将上面的hadoop修改为yarn,不过结果测试,不管怎么写,yarn都是生效的,通过yarn Web UI能看出来。
另外我是以root运行的,所以sbin下的一些sh文件要修改:
HDFS_DAT离不ANODE_USER=root HDFS_DATANODE_SECURE_USER=root HDFS_NAMENODE_USER=root HDFS_SECONDARYNAMENODE_USER=root
最后的启动命令:
$ ./sbin/start-all.sh $ ./sbin/stop-all.sh
参考链接:
https://kontext.t开它ech/column/hadoop/265/default-ports-used-by-hadoop-services-hdfs-mapreduce-yarn
https://hadoop.apache.org/docs/r3.2.2/hadoop-project-dist/hadoop-common/SingleCluster.html
Tags:
相关文章
云计算开发:Python内置函数-super() 函数详解
热点描述 super() 函数是用于调用父类(超类)的一个方法。 super() 是用来解决多重继承问题的,直接用类名调用父类方法在使用单继承的时候没问题,但是如果使用多继承,会涉及到查找顺序(MRO)、...
【热点】
阅读更多标签: 东风日产 日产App 服务器故障 远程控制
热点云梦级8月23日云梦级消息,东风日产今日发文公告称,因服务器机房电力故障,导致车主 App 登录、远程控制等线上功能出现无法使用的情况,正在全力抢修,力争尽快恢复服务。 公告全文如下: 尊敬的东风日产...
【热点】
阅读更多云计算开发:Python3-endswith()方法详解
热点描述 endswith() 方法用于判断字符串是否以指定后缀结尾,如果以指定后缀结尾返回 True,否则返回 False。可选参数 "start" 与 "end" 为检索字符串的开始与结束位置。 语法...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.realsporting.com/buscador?buscar=谷歌maps群发程序|软件【tg:seogoogle987】,IYR
- https://www.livehindustan.com/tags/谷歌maps群发程序|软件【tg:seogoogle987】,QpI
- https://www.woorden.org/spreekwoord.php?woord=谷歌maps群发程序|软件【tg:seogoogle987】,AS8
- https://www.terramania.nl/catalogsearch/result/index/?q=谷歌maps群发程序|软件【tg:seogoogle987】,Sv0
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=谷歌maps群发程序|软件【tg:seogoogle987】,hkZ
- https://www.usslexington.com/?action=QUERY&s=谷歌maps群发程序|软件【tg:seogoogle987】,rYj
- https://www.remit.co.jp/vi/?s=谷歌maps群发程序|软件【tg:seogoogle987】,MYs
- https://www.ucycle.com/search/=谷歌maps群发程序|软件【tg:seogoogle987】,xoR
- https://www.thealexandrian.net/?s=谷歌maps群发程序|软件【tg:seogoogle987】,zT5
- https://jihoon471.cafe24.com/product/search.html?banner_action=&keyword=谷歌maps群发程序|软件【tg:seogoogle987】VYK
- https://www.sonepar.ch/fr/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,2Ba
- https://www.tombow.com/search/谷歌maps群发程序|软件【tg:seogoogle987】,ehd
- https://www.wheels24.gr/?action=CHECK&s=谷歌maps群发程序|软件【tg:seogoogle987】,PNh
- https://www.schenckprocess.com/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,ZkE
- https://www.lifesciencesweden.se/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,xgr
- https://www.pierreherme.com/catalogsearch/result/?q=谷歌maps群发程序|软件【tg:seogoogle987】,mAj
- https://wwwcp.umes.edu/search/谷歌maps群发程序|软件【tg:seogoogle987】,hwA
- https://www.lneg.pt/?cat=140&s=谷歌maps群发程序|软件【tg:seogoogle987】,OFw
- https://5gaa.org/?token=6e2l7hjt2i26gzgctgwdrv7v0j6nxorq&s=谷歌maps群发程序|软件【tg:seogoogle987】NbA
- https://www.pmindia.gov.in/en/?s=谷歌maps群发程序|软件【tg:seogoogle987】,RZA
- https://www.tarleton.edu/?s=谷歌maps群发程序|软件【tg:seogoogle987】,CD1
- https://www.repetto.jp/item/search?action=QUERY&q=谷歌maps群发程序|软件【tg:seogoogle987】,NC7
- https://www.lyrics.com/lyrics/kkk3谷歌maps群发程序|软件【tg:seogoogle987】,Roo
- https://www.pixiv.net/tags/谷歌maps群发程序|软件【tg:seogoogle987】,FFV
- https://www.parl.ca/legisinfo/fr/projets-de-loi?parlsession=all&view=list&keywords=谷歌maps群发程序|软件【tg:seogoogle987】,xxF
- https://www.nyif.com/catalogsearch/result/index/?f=sarbanesoxleyU&index=me_cms_pe&lit=20&mode=list&p=1&q=谷歌maps群发程序|软件【tg:seogoogle987】,kXZ
- https://www.zutari.com/?s=谷歌maps群发程序|软件【tg:seogoogle987】,WOU
- https://www.skicheck.at/en/?action=CHECK&s=谷歌maps群发程序|软件【tg:seogoogle987】,KIE
- https://www.ussalabama.com/?action=CHECK&s=谷歌maps群发程序|软件【tg:seogoogle987】,kXJ
- https://www.lssystems.co.uk/search?page=0&per_page=24&term=谷歌maps群发程序|软件【tg:seogoogle987】,Oa6
- https://www.vfw.org/search-results?q=谷歌maps群发程序|软件【tg:seogoogle987】,W6V
- https://www.seagrant.wisc.edu/?page=63&s=谷歌maps群发程序|软件【tg:seogoogle987】,zi9
- https://www.sic-info.org/vi/?s=谷歌maps群发程序|软件【tg:seogoogle987】,otR
- https://www.remit.co.jp/en/?s=谷歌maps群发程序|软件【tg:seogoogle987】,WYn
- https://www.wilsonart.com/catalogsearch/result/?action=CHECK&q=谷歌maps群发程序|软件【tg:seogoogle987】,SIe
- https://www.openstreetmap.org/search?query=谷歌maps群发程序|软件【tg:seogoogle987】,IS7
- https://www.temu.com/search_result.html?search_key=谷歌maps群发程序|软件【tg:seogoogle987】F2P
- https://www.mintos.org/?s=谷歌maps群发程序|软件【tg:seogoogle987】,1YR
- https://www.randjleather.co.uk/index.php?route=product/search&tag=谷歌maps群发程序|软件【tg:seogoogle987】,KWS
- https://www.shopping.com/search.html?keyword=谷歌maps群发程序|软件【tg:seogoogle987】,RxL
- https://www.goodreads.com/quotes/tag/谷歌maps群发程序|软件【tg:seogoogle987】fVU
- https://www.scivee.tv/?s=谷歌maps群发程序|软件【tg:seogoogle987】,oEX
- https://www.rea.govt.nz/search?searchterm=谷歌maps群发程序|软件【tg:seogoogle987】,0X9
- https://www.ng-slo.si/si/iskanje?cat=114&q=谷歌maps群发程序|软件【tg:seogoogle987】,3sB
- https://www.springfieldlibrary.org/?s=谷歌maps群发程序|软件【tg:seogoogle987】,oAd
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=谷歌maps群发程序|软件【tg:seogoogle987】Pdi
- https://www.miamiopenmri.com/?action=CHECK&s=谷歌maps群发程序|软件【tg:seogoogle987】,Fd7
- https://www.kawainter.com/catalogsearch/result/?q=谷歌maps群发程序|软件【tg:seogoogle987】,j7q
- https://www.swecobelgium.be/?page=9&s=谷歌maps群发程序|软件【tg:seogoogle987】,l5I
- https://www.maigoo.com/search/?block=&q=谷歌maps群发程序|软件【tg:seogoogle987】,CdH