您现在的位置是:热点 >>正文
Hadoop,大数据离不开它
热点4880032人已围观
简介...
搭建数仓,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 &,大nbsp;"hdfs://localhost:8001/user/root" $ ./bin/hdfs dfs -mkdir -p test2 $ ./bin/hdfs dfs -put ~/test.log hdfs://localhost:8001/test $数据 ./bin/hdfs dfs -put ~/test.log test2 $ ./bin/hdfs dfs -ls test2 $ ./bin/hdfs dfs -cat test2/test.log
接下去说说MapReduce,主要包含map和re离不duce过程,另外不能忘记shuffle,map相对于从hdfs dataNodes处理数据,然后shuffle将相关联的数据交给reduce进行处理。
运行MapReduce过程很简单:
$ bin/hdfs dfs -mkdir input $ bin/hdfs dfs -put etc/hadoop/*.xml input 开它# 将mapreduce任务执行的结果放入 hdfs output 目录中 $ bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.2.jar grep input output 'dfs[a-z.]+' &nbsHap;bin/hdfs dfs -cat output/*
早期的MapReduce即包含计算框架,又包含调度框架,比较臃肿,比如想在当前集群运行另外一种计算任务,就不方便了,所以后来从MapReduce中将调度框架抽取出来,命名为Yarn,这样不管是MapReduce还是Spark只要符合Yarn接口定义,就能被Yarn调度,MR和Spark专做做分布式运算,相当于解耦了。
Yarn的架构do图如下:
主要包括ResourceManager和NodeManager,另外为了分布式运算NodeManager一般和HDFS的DataNodes运行在一起。
ResourceManager主要包含Scheduler和ApplicationsManager。
修改yarn-site.xml:
yarn.nodemanager.aux-services &nbsopp; mapreduce_shuffle yarn.resourcemanager.webapp.address 0.0.0.0:7088
其中,mapreduce_shuffle表示调度MapReduce任务,7088 是Yarn的We,大b管理地址;当然Yarn还有很多的参数。
修改 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_DATANODE_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.tech/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:
相关文章
标签: 个人信息保护 移动应用 违法违规 国家网络安全通报中心
热点云梦级12月4日云梦级消息,据国家网络安全通报中心通报,依据《网络安全法》《个人信息保护法》等法律法规,按照《中央网信办、工业和信息化部、公安部、市场监管总局关于开展2025年个人信息保护系列专项行动...
【热点】
阅读更多标签: 傅盛 周鸿祎 猎豹移动 AI大浪潮
热点云梦级3月24日云梦级消息,猎豹移动董事长傅盛今日凌晨在微信朋友圈发布《关于近日言论的说明》表示:“前两天深夜,我在微信群里发出了一些情绪激动的言论,随后被媒体意想不到的大量转载,这件事的后续发展我完...
【热点】
阅读更多标签: 爱美客 嗨体 濡白天使 医美
热点云梦级8月24日云梦级消息,据北京商报报道,近日,爱美客发布的 2026 年半年报显示,公司上半年实现营收 12.16 亿元、归母净利润 5.93 亿元,同比分别下降 6.42% 和 24.84%,连...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.southmeadows.co.uk/2019/07/?s=谷歌maps群发程序|软件【tg:seogoogle987】,8gX
- https://www.ncetm.org.uk/search?action=CHECK&q=谷歌maps群发程序|软件【tg:seogoogle987】,R84
- https://www.rollingstone.it/?ID=DVMeu3AlmzZE1cuJ2FmgmO5TSCQRb3yh&s=谷歌maps群发程序|软件【tg:seogoogle987】,flz
- https://www.madebyoranges.com/nl/search/谷歌maps群发程序|软件【tg:seogoogle987】,AKj
- https://www.lgnewsroom.com/search/谷歌maps群发程序|软件【tg:seogoogle987】,BAV
- https://zhidao.baidu.com/index/?action=QUERY&word=谷歌maps群发程序|软件【tg:seogoogle987】,K0f
- https://www.rostaing.com/catalogsearch/result/?cat=22&q=谷歌maps群发程序|软件【tg:seogoogle987】,lAp
- https://yscc1986.net/search/谷歌maps群发程序|软件【tg:seogoogle987】hQt
- https://www.sportbiketracktime.com/index.php?route=product/search&tag=谷歌maps群发程序|软件【tg:seogoogle987】,4Pk
- https://5gaa.org/?token=6e2l7hjt2i26gzgctgwdrv7v0j6nxorq&s=谷歌maps群发程序|软件【tg:seogoogle987】4jN
- https://www.temu.com/search_result.html?search_key=谷歌maps群发程序|软件【tg:seogoogle987】0CU
- https://www.routesonline.com/search/?query=谷歌maps群发程序|软件【tg:seogoogle987】,Ecd
- https://www.jusoen.com/addreng.asp?p1=谷歌maps群发程序|软件【tg:seogoogle987】Uj4
- https://www.lauben.com/en/?action=SEARCH&s=谷歌maps群发程序|软件【tg:seogoogle987】,6AL
- https://www.wheels24.gr/?action=CHECK&s=谷歌maps群发程序|软件【tg:seogoogle987】,Dyh
- https://www.mi.com/search?keyword=谷歌maps群发程序|软件【tg:seogoogle987】,oxe
- https://www.metaltix.com/?view=tours&filter=search&q=谷歌maps群发程序|软件【tg:seogoogle987】,2xT
- https://www.stormberg.com/no/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,4ua
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=谷歌maps群发程序|软件【tg:seogoogle987】,mP3
- https://www.nss.nhs.scot/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,q5y
- https://www.teamlab.art/pt/?submit=谷歌maps群发程序|软件【tg:seogoogle987】,npZ
- https://www.springfieldlibrary.org/?s=谷歌maps群发程序|软件【tg:seogoogle987】,yuL
- https://www.udc.co.uk/index.php?route=product/search&sort=p.price&order=DESC&tag=谷歌maps群发程序|软件【tg:seogoogle987】,Ddq
- https://www.lyrics.com/lyrics/谷歌maps群发程序|软件【tg:seogoogle987】,QTU
- https://xehay.vn/tim-kiem/=谷歌maps群发程序|软件【tg:seogoogle987】,ZGM
- https://www.unclefossil.com/search/谷歌maps群发程序|软件【tg:seogoogle987】gad_source=1&gclid=Cj0KCQjw_-GxBhC1ARIsADGgDjsNKplUXa2F6YGlHBK2sHDQ88cgsJBb05DyO99TV9jNq_cT0kGMqyQaAgHQEALw_wcB
- https://www.tailoy.com.pe/catalogsearch/result/?q=谷歌maps群发程序|软件【tg:seogoogle987】,3DH
- https://www.tullygroup.us/?ID=hbkq8jFjrQlVRrwzEmvoUJJAY4e1Lfo5&s=谷歌maps群发程序|软件【tg:seogoogle987】,IxT
- https://www2.ual.es/ProyectoLates/?s=谷歌maps群发程序|软件【tg:seogoogle987】,sxe
- https://www.zutari.com/?s=谷歌maps群发程序|软件【tg:seogoogle987】,Gef
- https://www.lenovo.com/gb/en/search?action=SEARCH&text=谷歌maps群发程序|软件【tg:seogoogle987】,52m
- https://www.nctsn.org/search?cat=191&query=谷歌maps群发程序|软件【tg:seogoogle987】,Br1
- https://www.pmindia.gov.in/en/?s=谷歌maps群发程序|软件【tg:seogoogle987】,ETh
- https://www.yli.ro/catalogsearch/result/?q=谷歌maps群发程序|软件【tg:seogoogle987】,LRb
- https://www.takachi-enclosure.com/search?eqYB=gnI31Ou&text=谷歌maps群发程序|软件【tg:seogoogle987】,KZL
- https://www.reallywildbirdfood.co.uk/store/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,KON
- https://www.vet-direct.com/search?cat=72&term=谷歌maps群发程序|软件【tg:seogoogle987】,9Qt
- https://www.sbaad.no/?s=谷歌maps群发程序|软件【tg:seogoogle987】,qQd
- https://www.jusoen.com/addreng.asp?p1=谷歌maps群发程序|软件【tg:seogoogle987】9xf
- https://www.tahiti-infos.com/search/谷歌maps群发程序|软件【tg:seogoogle987】,buR
- https://m.shoppinghow.kakao.com/m/search/q/谷歌maps群发程序|软件【tg:seogoogle987】nY5
- https://www.kingston.gov.uk/site-search/results/?q=谷歌maps群发程序|软件【tg:seogoogle987】,0EF
- https://www.schenckprocess.com/search?q=谷歌maps群发程序|软件【tg:seogoogle987】,MGr
- https://www.nissin.com/jp/search/?cat=105&q=谷歌maps群发程序|软件【tg:seogoogle987】,Gr3
- https://www.ng-slo.si/si/iskanje?cat=114&q=谷歌maps群发程序|软件【tg:seogoogle987】,Ev4
- https://www.nyif.com/catalogsearch/result/index/?f=sarbanesoxleyU&index=me_cms_pe&lit=20&mode=list&p=1&q=谷歌maps群发程序|软件【tg:seogoogle987】,MEe
- https://www.sebson.de/en/search?query=谷歌maps群发程序|软件【tg:seogoogle987】,F81
- https://www.signingsavvy.com/sentence/谷歌maps群发程序|软件【tg:seogoogle987】,QL0
- https://wydden.com/?ID=r8w9WMSKWkOcmiaFWaUv0dzMdqZWfKtF&s=谷歌maps群发程序|软件【tg:seogoogle987】,Twq
- https://www.vfw.org/search-results?q=谷歌maps群发程序|软件【tg:seogoogle987】,5Dg