Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告_第1頁
Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告_第2頁
Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告_第3頁
Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告_第4頁
Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告Hadoop云計(jì)算實(shí)驗(yàn)報(bào)告實(shí)驗(yàn)?zāi)康脑谔摂M機(jī)UbUntU上安裝HadooP單機(jī)模式和集群;編寫一個(gè)用Hadoop處理數(shù)據(jù)的程序,在單機(jī)和集群上運(yùn)行程序。實(shí)驗(yàn)環(huán)境虛擬機(jī):VMWare9操作系統(tǒng):ubuntu-12。04-Server-x64(服務(wù)器版),UbUntU-14.10-desktop—amd64(桌面版)Hadoop版本:hadoop1.2.1Jdk版本:jdk—7u80—linux—x64Eclipse版本:eclipse—jee—luna—SR2-linux-gtk—x86_64Hadoop集群:一臺(tái)namenode主機(jī)master,—3datanode主機(jī)salve,master主機(jī)IP為10。5.110。223,slave主機(jī)IP為10.5。110。207。實(shí)驗(yàn)設(shè)計(jì)說明主要設(shè)計(jì)思路在ubuntu操作系統(tǒng)下,安裝必要軟件和環(huán)境搭建,使用eclipse編寫程序代碼。實(shí)現(xiàn)大數(shù)據(jù)的統(tǒng)計(jì)。本次實(shí)驗(yàn)是統(tǒng)計(jì)軟件代理系統(tǒng)操作人員處理的信息量,即每個(gè)操作人員出現(xiàn)的次數(shù)。程序設(shè)計(jì)完成后,在集成環(huán)境下運(yùn)行該程序并查看結(jié)果。算法設(shè)計(jì)該算法首先將輸入文件都包含進(jìn)來,然后交由map程序處理,map程序?qū)⑤斎胱x入后切出其中的用戶名,并標(biāo)記它的數(shù)目為1,形成<word,1>的形式,然后交由reduce處理,reduce將相同key值(也就是word)的ValUe值收集起來,形成〈word,listof1>的形式,之后再將這些1值加起來,即為用戶名出現(xiàn)的個(gè)數(shù),最后將這個(gè)〈key,value>對(duì)以TeXtOUtpUtFormat的形式輸出到HDFS中。程序說明UserNameCoUntMap類繼承了org。apache。hadoop.mapreduce.Mapper,4個(gè)泛型類型分別是map函數(shù)輸入key的類型,輸入value的類型,輸出key的類型,輸出value的類型。UserNameCountReduce類繼承了org.apache。hadoop。mapreduce.RedUCer,4個(gè)泛型類型含義與map類相同.main函數(shù)通過addInputPath將數(shù)據(jù)文件引入該類,在通過SetOUtPUtPath將生成結(jié)果轉(zhuǎn)為一個(gè)文件,實(shí)現(xiàn)生成結(jié)果,即統(tǒng)計(jì)結(jié)果的查看。FileInputFormat.addInputPath(job,newPath(args[0]));FileOutputFormatoSetOUtPUtPath(Job,newPath(args[1]));程序具體代碼如附件中源程序。4實(shí)驗(yàn)過程4.1安裝實(shí)驗(yàn)環(huán)境安裝ubuntu操作系統(tǒng)打開VMWare,在Hometab中單擊“CreateaNewVirtualMachine”,選擇CUStom,選擇虛擬硬件版本W(wǎng)orkStation9。0,選擇ios文件,next,錄入目標(biāo)操作系統(tǒng)信息,包括Fullname、Uername和Password,next,4)選擇默認(rèn)的選項(xiàng),一般不做更改,最后確認(rèn)信息,F(xiàn)inish,5)安裝成功后,會(huì)看到如下畫面,4.1.2 安裝配置Samba安裝samba主要為了實(shí)現(xiàn)與windows操作系統(tǒng)的通訊,由于server版本的ubuntu沒有自帶圖形操作界面,所以下載資料等操作不太方便,這也是安裝samba的目的之一。1)安裝samba,輸入如下命令:Wh日口國UtllJntU二e牛sudoapt-getin≡ta11≡amt∣a-2)安裝Vimzha□Oubuntu:rj¢εud□apt-getinstall√im_3)創(chuàng)建共享目錄,并修改權(quán)限WhaCl?ubuntu=sudochmod111share4)配置Samba。修改samba的配置文件/etc/samba/smb。conf,將SeCUrity=Share,并在文件的末尾追加如下內(nèi)容,ZhaaSubuntu:ru?sudovi∕1Etc√^3f∏bj√'gf∏t∣.∣Ξ□nf[share]path二∕home∕Ξhao∕≡harepublic二yesuuritable二yes5)測試。在windows實(shí)機(jī)中,通過ip訪問ubuntu虛擬機(jī),可以見到Share文件夾"鶴vl?Lt.k10.5410.223?f?f4CR=⑹??M工具E幫助時(shí)汩織, 網(wǎng)絡(luò)和共享中心 登君遠(yuǎn)用T印機(jī)share/揉庭 . ±±s^?、-r3&=PP號(hào)安裝配置JDK首先,下載java開發(fā)工具包JDK.在本次試驗(yàn)中,我們下載的版本是jdk-7u80-linux—x64.gz。解壓安裝到/usr/lib/jvm/目錄下,更名為java-7-sun。配置環(huán)境變量/etc/envirOnment,LrilH-'/j?r/_3cal/?tin:/.?eal/?in:/uepzebin:,■,u:r/:in:∕≡bLr:ztin: g≡πe∈:zusr/1ib∕Jvm/jaya-7-suπ/bin:/opt∕hadoop∕bin'ΓI-SATH-.;?-,ι.x√Iil∣-?,.7I√,i∏Vd-7->.ji√1i∣∣√H?H>u^t-∕u≡r∕iιb∕Jja?£-/-slπ使配置生效zha□Oubuntu:/usr/lib/Jvm$source∕e-tc∕en√ironment測試安裝配置結(jié)果ZhaoOubuntu:Java-versionja√a√er≡ior"1.7.0_80"Java(TM)SERuntimeEnvironment(build1.7,0_S0-bl5)Ja√aHotSpotCTM)64-BitSen√erVM(build24.SO-bllπmixedmode)在單節(jié)點(diǎn)(偽分布式)環(huán)境下運(yùn)行HADOOP1)添加Hadoop用戶并賦予sudo權(quán)限2)安裝配置SSHzhaα(≡u(píng)buntu:√home?sudoapt-getinstall□penssh-ser√er切換至hadoop用戶,ZhaoOubuntu=ZhomeSsu-hadoopP□33u∪□rd:hadoop?ubuntuιr"Φ_配置密鑰,使得hadoop用戶能夠無須輸入密碼,通過SSH訪問localhost,測試結(jié)果:IiadoopOubuntu:rj3sshIocalhostWelcometoUbuntu12.OdLTS(GNU√Linu^3.Ξ.0-Ξ3-gener?icHS6_6d)小DuluiiicIiLdIiu∣ι;IiILμ≥,;/'/'lιelμ.uL∣uιιlu.uu∣ιι∕'NCUrelease'1-1.Od.2LT≡'available.Rnn'ri□-r?p1pm個(gè)口一IlrlgPmrIp't∩∣ι∏gradptnit.LostIogin:GunM□y10OO:24:C3ZCllSfrommasterh日ci□□p國LltlLlntLI:卡_3)安裝配置HadooP首先下載Hadoop,解壓縮到/opt/hadooP目錄下,本次試驗(yàn)中我們下載的版本是hadoop—1.2。1—bin。tar。gz,更改目錄名稱為hadoop.修改與hadoop相關(guān)的配置文件(在/opt/hadoop/Conf目錄下),分別是Core-Site.xml,hadoop-env.sh,hdsf—site。xml,mapred-site。xml.在此不一一歹U舉。4)運(yùn)行Hadoop首先格式化HDFS,had□□p0ub∣.ntu:/opt∕haclοοp∕bin¢?∕hadοοpnamencce--οrmat15/05/17|.E:33:3?INFOname∏∏de,NgηeN∏de:3TfiRTUP_MSB:「.〃山Z士 ■^山山士山士^V*山 ?'?Z士 山山士 山?J1 山士∣- E?+-+F?P?T?'T"?T?+?+F-Γ??T?-T-,■■?T?■+T-T??T?EE?T??+-+F?T?E,■■E+-+千-Γ??T?,■,?T?++T?-Γ??T?-T-,■■E+T-f?T??T?E,■■+-+f3TP'TJΓ.M≡■:二Mrti”HEirmtlE:;IΓ"III'_H:E: h「二 t = Ul-ITlJ;1 f .Q 一?..:EIT二TIPHf:; :jij = ---HIt]STr=TJP.MS:: Vf l1j∣i =1.2,二^IF-IIl'_11:--: hli I 7- ∣--t-三:二'C -" ..rrg.'r=-^∣y.'?=uI,l?=ι∣?∣n-1「「「-,1"HI"K∣-=:/1'r∏r---.:J-- -Hu:-I l-!rr?rr il∩riIz ,n∩--f' mPr- .u L - -h : : Tp∣j∣ ?.∣χSTP-TJPMS: : i?? ?-L.^J.Z.8uR「f■^π∩-f i .-?^y^r--H:∏/- -↑×h∩r? ■■^∕~r?^, τl∩∩r/ ^/nrrr - ■ :T ---i: ∣jFuiIUlu∣jf IjJ_i.j:/l√ jμ∕,.ιι; ιuduι^■1 .If∪∕ι√ ιι.二5.:”二1C:::'3:3EI?z0lcurιudeΛ;iuNul-z:≡HUTD>'LM≡G:J:*.:*;;+:沖:.木J???j∣?:*;;十;ψ.?.????.Zφiψψ.?Λfc?ζ??ψ:*;沖:撲:J???:和:*;ψψ.?jfc???tψ;+;;+:J???*.:*;:+;;+:撲:.*?ζ*.:*;:+;;+:;+:.木Jfc木.*.:+;5HIl`IHUI’?::^:hi,ttIIg∩rn-N∩[rr?--∣∩∩-.∩ιr∣-∣./I-,.u.I.I平平水牛:+:,邛*率牛+:+:,**率隼軍事*印軍事軍中:+:*¥¥率軍:軍:+:春率¥*卡率+寓率*率*軍中窣¥*率*軍中:+::+:邛¥*#,h日d□□20uljLQtu二J□匚t/h30□匚i”bIn軍_啟動(dòng)單節(jié)點(diǎn)集群,p-tasktr?eker-ubuntueοutlοcaLh□≡t:π∣v:cannotstat"..oρt√hado□ρ∕libexec∕-.∕l0g≤∕hadD0p-hadoop-tasktracks

r-ubunlL.outj4l:N□siEhfliejγcll∣-ectDryLocaLhast:startingtasKtrackEr1L□ggi∏Eto/opt∕had□□p∕Iibexec/.-∕lαgs∕had□□p-h

ad∣∣)p-ta≡κtracκer-ut∣ur∣tu,outr∣aster:Siartirgtaskirackerlloggingtd∕oplxhadΞ∣op∕libexBC/'.j∕lDgΞXhad□op-had□

eD-tasktracker-ubuntu.□utmaster:ULimlt-aIopuserhadoopr∣aster:corefilesizeiblocks,-riInaster:data≡.eβsize(kbytes-d)unlimiiedmaster:schedulingpriority(-e?0master:filesize(blθCK≤p--FJunlimitednaster:pendingsignals(-1)3739master:maxlackedmemoryιkbytes,-L?64master;帕Xmemorysize(kbytes,,-n)unlimitedr∣aster:口PE-IfLiesIfιozqmaster:pipesize¢512bytesa-p:1C通過jps查看,masterhadoαp?ubuntu:∕□pt/hadoop/bin$jpsEO02TasKTracken1BΞ3SerondaryNameNade性卻Jps146。Naτ∣eNodeIlqlClJ□bTr已匚1巳「slavehad□opeubuntui∕c∣ρt∕hadoop∕biniJpsΞ353Task'iraci:er2442Jps2263DataNode停止單節(jié)點(diǎn)集群,h;.:m :ι3∣.: IJI I U; -?ιι∣I -I :iι :i/: ιL.>;:C:i:,I.;lStμ∣ i"E JI : ,∣ :i:k-":;;:I "I : I :t:止 I?; .ι ?4.1.5 在多節(jié)點(diǎn)(分布式)環(huán)境下運(yùn)行HADOOP1)設(shè)置/etc/hosts文件實(shí)驗(yàn)中兩臺(tái)機(jī)器處于同一局域網(wǎng)中,其中一臺(tái)作為master,ip地址為10.5。110.223,一臺(tái)作為slave,ip地址為10。5.110。207,修改兩臺(tái)機(jī)器的/etc/hosts文件,127.0.0.L

10.5.110,ΞΞ3

07Iocalhost

ubuntu

master

slave2)設(shè)置節(jié)點(diǎn)之間無密碼SSH登陸驗(yàn)證配置SSH是否正確3)修改集群配置文件修改master的masters、SlaveS,修改所有節(jié)點(diǎn)的core-site。xml,hdsf—site。xml,mapred—siteoxml,在此不一一列出。4)在master上格式化HDFShadoop?ubuπtuι∕opt∕had□□p∕bini.∕had□opπamen□de-f□p∏at-5)啟動(dòng)和停止集群啟動(dòng)集群,在master上啟動(dòng)HDFS后,jps結(jié)果如下:masterIOIJLI」kR」LUni.L;:川CIlJ」LlJ,Zin£j心Trt?k-rd∣kH"z∣l42!:ezcnd≡r∣jN≡ππeMcdeΞ770NafneNodeslave|naLoozQ_bu-7L:∕zpt?jhjdozp?bι-≡ip:Eb-七JpsZ573DataNode在master上啟動(dòng)mapreduce后/ps結(jié)果如下:masterhadoop@ubuntL:/opt∕hado□p∕bin≡Jps2∩R?Ta?^kTrarkPr3457Job-Packer3142SecondarqNameNode2770NameNode3806Jpsslavehaι□opθubuntu:/optZhadocpZoinSJDSΞ573DdLdNuLe2S?6JpsΞ736TaskTΓ,cCk≡r停止集群kadoo?dubu∏1l:∕□pt?'nadooi:/ti口中.?z≡:op-rncpr?∈d.EnstoppingJoLtracke-adoop@ubuntu:/opt/hadoop/bin$./st□p-dfξ.shtoppingnamenode4.2運(yùn)行程序在單機(jī)上運(yùn)行程序(1)(2)在Eclipse下,新建map/reduce工程新建一個(gè)java類USerNameCoUnt,編寫代碼B!B?HLbraι>.Lu??w?ι?rI埠?ahM∣≡∣?∏>rtE?pferp-aS"2 *呼五1*5LiM<∣QE2g■咨He_3田hq?4fbflU5tιΓMΠ>KnUfiUIm1*JHE5??tBm出HTljd"M?T?ιMil?H∣M{W∣r-Π∣r*∣r>?-5.5?l≡∣βr≈l?pζiIWΓ∣??gnr,2Jl*gr∕40[∕nadoop^1lb卜∣∣∣∣bAIKkSOfrC51-1?AJlΓ-?<φi??AhfniJ4?FU叫IugB例心AQjJFj∣j4∏g?j1?-1.^.J≠j∣r-.?∣?Λiflrt∏rj∏?S∣B□?-1.i=∣5.jM∕0g???j□σp^b?自≥i≠4C事D1.BL11.1"?SSiMJ-ISiPHl胃3JHΓ-∕i?pr∕hMri∏∏[y1φa@torτwniMH-c?dκ-τ4田?冷ρi√h?dm?"S∣rtty-d-lJαjιr~il□≠^hκ-Hf:^ih?REElnEFC?-3]所JQP甘愉4?97a白叁ImlIn&iu?b3ΓN*?ι.r.CLiz/∣,oj?ll卜β∣itckfrVrπjap3flΓ-dHi-F1J.)flΓ-?ept√'i"Hcofi?∏σp?-dlge5?r-1耳*-向pt?lHIN向5rr*ι"M*∣.dγUm?QEErlMlf"τι>rtifμrVtkH-IfJgr”杓Gl*自[(JnWHWBrdZJJar['OpyhUdQDB]?gItfhM-OJ-IfAr?ι∣?0∣√TUdUUMIo?≡∣rt∣y??‰Wμr-il∏PΓi,???,fc''a@mm(HK?bMmfcdx5門內(nèi)/加A*■Jinm-LNllrjanX?>dκp1lU:?Heπ≡iotrm≡HO-jB<?-,?pu?d(κ?∣∣∣上SJer5ey-ure-1?AJιr卜日mac*l?c→d?lJlSlJk■^p?∕τwcccp,∣lb口hsdwρ*ι∣r?*e?fer-i2∣1.Jar∣?ρ?fl∣hLh-D.1L-4ZjJl'-.>????*dLH?∣j?b?≡Zd^e?EMtky*hβ"dkW∣1?U^lyMvN∣m?C∣><jBt∣^v?期Ilr二1Fg"?∣MWj?■?∣Bp?arE?gra"-!∏-TQEiCCPt]Vn;[]LtPEiilLce!j31U∣BΓ∣?∣MΓamt?2D工LIWfaLiCIULLE?IdtikUtiι≥ιINhLlijiiCH?PhE?eI?Jl fUWY--L?fqiir∏jabLti:,T?fi:,T4∣πrEITmnlfibL**[2$p>riγ*τ?-fiβ*L[∏w^4bli!-N史▲IjiwLcwleUi:prlvιrt*T?ι?κιrd=?t≠Turtfl-*≡J? PlEl依 呷SLhi汴ritιiAChey.Twrt¥alιιel.Cπt?κtwfrtwtl-t?rw?JMκ-rwtLe∏al∏tpr∏jp?<5Γfrpri>s∏iStrLirgilw≡■VaV",??tri?plJιio Strιm?r≠pιiwr1fl?n■■ 來r∏?MMEnlEIJnml;31 vhi,Lv?-Iakan.÷∣Aβlfar4T□k≡ιa∣?11■(31 VDΓd.∣Bt[t□?πι.∏κτfcTaka∏OI;J3 CM14M.E.HllCAIιrtΓdr4fM∣;∣?? p∣bli>cf∏Uε?l-∣5-fU妙rN4FSv∏t區(qū)My??jcer<Tκt,I"i*^-Lr?l<sTert-In*r±?b2I;Pl帆抬w<4rEMW"EtkΓK∣]tr≡r?lr<I"1WrLt∣5≡>?s-MUg*?DiltrtWntMt卜 thnwH [K∏Pe∣Ttj4∏∣Im?rrupt?gEιofPtlσn!-P i∏C, Jim≡9j■4+ ear ?THlhft-Ltfl?lv vbL : vλ'∣uvbJ ?43 GlM+-v?L.?ti>[IHme- 1LJ^Nπ[.wΓXCA?h?yl∏nIillinfLCM>?∣hiri)∣;事寫JFiEllFt2??r≡K?ur?[J?flAprtcrt?H√?^∣M*∣πv]ιva?^Jv???? ∣,5?Sti5∣*£];55?MI1Sj?5>∕1S的:上3:強(qiáng)IIM:由PiprfiaJebCLmvT: C*UTLk耳ETUidT15∕βSj,15&4:上±:3Π?Fβ■睜他f.Ji*niie≡τ15^<I>∕D?4123:!?]J≠aBiprBfJrtClievt.15^V35?4∣2J=HJM=C!呷rNJBCH:15∕βVDMi":W]H≡QMpretf.J?Πιerτt15ΛβWJ5 !M7fl≡*p∏rf.J?Cliff?t:MErtLdIικmr^IbMtei∣1ιr?p??t^??∏WβYTE1iχH???ouipvt<?oaEu!l與時(shí)上g?i∏甘ιmr?γkp?≡???0fLnPH≡?Cfli∏j5-]*5M1=■B襠£.甲∣iCeX?|O酉西eλq?s辱K.INHiHnMUmEYklMI:— .?■J= ■F JL(3) 運(yùn)行程序,結(jié)果如下:1DJEL3-e4-j3-5M1*ElrLl?i;≡S551笳訝Jaβu.H5SIaJ的l>L5?4:■軸二疆IWEFC4.打MUiM給[郵dbθιL^Uiulr^匕Pr獨(dú)I時(shí)M卜WiH?Uti∣-4.-IJtLjtf也口丫3?呻仃L「i?Lomr>απi-bMnuti∣5?cc≠E-i4.4jar■/,GVjm工ZjIK?∣l∏P?∕?WWfi∕∕bB仁CwTμ≡ww??LqwEMlha???∕?卜QjEry?Ere?Imkr-I?gΛMπfl口力也F向他岫比TiluApiT■坦中SridMW'?ggdnw∣√市rgEMtJitJ.中『?也口:■目inHLi.Wtjjr.'-I1MdGU口JUb?ι≡had口呼口wt*[hedLitrT芯IJif卜PCOTnEnSFK??21Jx-l∣op?,??≡?wχ∣a.Jo?cLj*6τ=*IE?門口?d.ι*MIIvkUm:Ucnt.h?V4d.JMLL14?τ;P∏?CljfRt-*■@3n2班」口磬力/WljlIl∣X邛口旗

*■自∣ι^ιun?r-0>lliL∣ur∣?-jj.ι.jjr?,∣?ι

?包iiifiN』Nr.出glud口口Mb?Slu4dbT.BιCd4*r陽口gd。0MI

卜,∣W5?∣5∏iV-1.ftJlf?P?f-hK?2Pjllb

.包IdfffiPlBJIr?7cfM??pjlb卜k≡DMT1?Ore"MtprtEtIQFM”國!

?RMldnnIHFr北尿I工Eμr-,!?pl.∣FMri:

?自 IUjJ產(chǎn)r?i,gc戶IMIUUMh.Ii ItIWrad^bf:FJtI?信SmglU1粉口£電討,10pHi?±.?

,包8rU.1J*-∣rt??Λ?doop∕5b?gCWnEE??HF1。Iι,Lp≡--∕?p?h?s

?f?∣ff≡ey-M<w∣r-1∏Bjw-?rt∕?wpΛ

?目FIedQQlDaHkMaIiMilJer?拉PM*>*dnn

仲盲IudoDp4-^μμlud4c-

■@Fudoaβ-c?r-fr-ι.iι4*JngilMd??L

卜之Mdnnk占地?l≥-Qm,,∣jpu^d>.,L?^L>*υ5均g"?HL1ΛMfH≠≡?<ItMiWIWISiEl111的J■汽單才1L46?J≠!ftE1M9”REWIgJ普電1句?

UEib∏?π<ISB:?^Bi∣iir≡]ι

總圖]由?工?林柏Wg碼空?? 1LE”把曲!■4:tHjMnlliR£5I11曲Li三口市QtiHJlE∣4?HL

L才a1由酬■J1*叫EΛ≡3dl4北寮11∏n田或曾同匕目]WW2ΛBW∏HI?=∏I∣氧打玉kK≡]】LSSU胃方214^iJEBH任,:J=ΓV,∣?*e?2IilMm1??.∣ι?≡J片胸E髭*厚1W即把《EgkWH*?fl*!? T]MMM∣∣a?aI口的L:E電㈤1L?H.-3?l??1UWiatTIIam?j?nt

用的三厘乂+0注H件1W時(shí)hjχ?H任Zl≡mτHA1i≈s?t-★道置EWDINfQIhfQIHfOIKFpua?[uilHMjIJf《口戶?i|

7PLΠmWTh-LKHapUnllUT*eEu:HBWZ

LW1ΛAUMLilFMwqE>*

∏E?p∣Z?Lfi(MiEEE問4TU215/05/1615/05/1615/95/161S/05/1615/05/1615/05/1615/05/1615/05/1615/05/1615/05/1615/05/1615∕□5/LG15/05/1015/05/1615/05/1615/95/Lfi15/05/1615/95/1615/05/1623:27:39INFOnapredtJobCllent:23:27:39INFOιιapredβJobCLleint:

23:27:39INFOmapred.JobClient:

zm二27二39inforapred.Jobclient:

23:27:39THFOmpred.JobClient:

23:27:39TNFOnaprecl.JabCllent;

?3:27;39TNFOHapredrJoDCLient:?3;27;35infomapred.JobClient;

?3;Z7;aginfoBiapredrJobcUent;23:27:33INFQmapred.JobClient:

23:27:33INFQIiapred.JflbClient:

23!:27!:39INF□napr∈d.JabClient!

23i27t39INF□πapr∈d.JobClient!23:27:39INFDπapred.JobClient:

23:27:39INFOπapr∈d.JobClient:

23:27:39INFOnapred.JabClient:

23127139INFOnapred.JabCkieπt:

23i27l39INFOnapred.JobCkient:23:27:39INFOnapredtJobCkient:C0□nter5i32θFileOutputFormatCounters

θytesWrltten=7Θ5583FileIriipMtFormatCounters

θytesRead='??45θ4?3FileSyste∣?Co∪πte∣,5FILE^BYTESRJEMl=I就區(qū)1417FILEBYTESWITTEN=I155ΘΘΘ7Map-KedluceFrameworkReduceinputgroup&=1SSE2MapoutputBaterializedbytes-53710□5Combine口UtPUtFEEords=HMapinputrecords=L454AHRiEdllrEshmfflεbytes=0PIiJfsicalmEiory(bytes)snapshot=θReduceoutputrec□rd≡=lβ862SpilledlRecord≡=29L164Miapoutputhytes=5θ79β35τot?LCOimitiedheap5日罪(bytes)=39?97^272(4) 在eclipse中編譯好源代碼后,導(dǎo)出程序的jar包,供在集群上使用.4.2.2在集群上運(yùn)行程序啟動(dòng)集群,通過jps命令查看master,slave上啟動(dòng)的服務(wù)列表,結(jié)果如下:∣?adoor0πt∣untu:/opt/hadoop/binSjps2049job??aeke??≡95?Jps15€1NameNadsl2221lask?raeke?1929SeccindaD^NaiBLaNodeItιad□□ρ0ilbuntll;/apt/?iada□p∕bin5ssh≡lavcWelcometoUbuntu12.04LTS[GNU∕Ltiiilx3.2.D-23-genencx86_64)*Documentation:https://help.?b?nt?.eon/New?eleaaell?,04.2LTS1available.Eim'ClQ-Teiease-Upgracierlqupgradeto?u.lastl□σin:SatMav1623:36:352015frc≡master?ιadoop0iib?ιZL,tu:Yjps152?JaskTracker∣1444DataNads∣rL83ΠJ□s(2) 在集群環(huán)境下運(yùn)行該程序jar包(USerNameCount.jar),結(jié)果如下:padQ0pgut>unnι:∕opL∕?adoαp∕t>lιι?.∕rado□p?ar∕□pL∕Hacl□αp∕UseXNarasCcnmr.Jat?ad,o□p.U^eiNoitieCDUzitinpu3output15/05/1?23:42:19WARNmaprad.JobCliant!lD≡eSeneτicpp∣=ionsParaerfe?parsingtheargimients?Appliaatiaiisshouldιιupl≡meιιtTq□1icrthesane.15∕05∕1<515∕0S∕1615/05/1615/05/1615∕0S∕1515/05/l€15/05/1615∕r05∕'ie15/05/ielΞ∕05√lfi15/05/1615/05/14515∕0S∕le15/05/1623:12:1923s42:1923:42:1923:?2:2O23:?2≡Ξ123:42:3023:42:3823≤?2≡?023:12:-5123≡42≡?123≡42≡-3123:?2≡?123≡42≡?123:42:^1INFOinput.FileIJ□puCF□zτnat:Tot∣□1inputpathstopr□cc≡5:1IMFOut?l-ITaLtiveCodsLeiadei?:Loadedthenative-hadeopIibraiyWARNsnappy,LoadSnappy:SnappynativelibrarynotloadedINFQnaprel?Jat-ClTenL:INFOZianprcdaJobClicnt:INFOmapr≡djJafcClient:INFOmarred.?JabClient:INFOiβapx?l-Jot-ClienL:INFOmapzed.?JobClicnt:ΓMFOτnapτed.JobCliant!INFOnapred.?JabClient;:INFO??mp?:ed-JabClicnt;INFOmap?ed^JahClient:INFOmarred,JobClient:RunningJOJO:?01>_2015051-62336_0002map0??eduae0?map100?reduce0?maLD100?reduce33%mao100?reduce100%Jobco∏φlete:job_2015051?233€_D002Counters:29JobCQiiEtersLaimckcdzeduceta≡k3βlΞLOTS_MILLIS_NAPS=0£58Totaltimespentb?rallreduceswaicιngalterreservιnιjsiets(zni3)=αlS∕05∕lfi23≡42≡?1INFOmap?ed.JatClient:Totaltira≡spe?-tbyallniapswait-xnlqafterreservingslats(∏l≡)=01Ξ∕D5∕1715∕D5∕171S∕D5∕171Ξ∕DS∕2715∕D5∕171S∕D5∕171Ξ∕DS∕2725O05?÷1S∕D5∕171Ξ∕DS∕2765011201S∕D5∕1700:07:4500:07:-330□:07M800:07:4300:07:?S0□≡07MS00:07:490□:07M800:07:490□:07:-58IUFOτπapred.JQbClient:infoinaprea.JQbCiient;:INFOme,pred-JobClient:INFOmapred.JobCLient:infoπaLpreα.JQbCiient;:INFOπm,pred.JabClient:ΠJFOmapred.JobCLient:INFOme,pred≡JobClient:TUFOτπapred.JobCLient:INFOmapred-JobClient:CPUtimespent∣z∏3}=4550eo?nb?neιrpucrec□nl3=0SPLIT_RAW_B¥TES-IlOReduceir?piotreeord≡=l47171Reduceinputgroup≡=ι?55D6Combineoutput?eeo?d?-θP^hy≡iea?rπem□ry(toytaa)snap≡?□t=2fiReduceQiitpucrecords-1?SSO6Virtualidemor7IlDytmmlSRapBhot=I94Hapoutput?Eeo?d?-117171(3) 查看集群環(huán)境下啟動(dòng)程序生成的結(jié)果,即output文件,結(jié)果如下:/user/∩adαop/0atphad□□p(4) 數(shù)據(jù)統(tǒng)計(jì)結(jié)果在part-r—00000中,具體內(nèi)容如下,99211812122131213142411221戈韻見潮脖陽攝天華輝華海文城奚昭曉朝朝松桂罡楠戰(zhàn)團(tuán)永江沐潔洲洸浩濟(jì)燕婀琛陳陳陳際陳暗晾陳陳p?陳陳陳際陳陳陳陳陳陳陳陳除陳5附件源代碼如下:packagehadoop;importjava.io。IOEXcePtion;importjava.util.StringTokenizer;importorg。apache.hadoop.conf.Confιguration;importorg.apache。hadoop.fS。Path;importorg.apache.hadoop。io.IntWritable;importorg。apache.hadoop.io。LongWritable;importorg。apache。hadoop。io。Text;importorg。apache。hadoop.mapreduce。Job;importorg。apache。hadoop。mapreduce。M

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論