分布式計(jì)算開(kāi)源框架Hadoop-入門實(shí)踐_第1頁(yè)
分布式計(jì)算開(kāi)源框架Hadoop-入門實(shí)踐_第2頁(yè)
分布式計(jì)算開(kāi)源框架Hadoop-入門實(shí)踐_第3頁(yè)
分布式計(jì)算開(kāi)源框架Hadoop-入門實(shí)踐_第4頁(yè)
分布式計(jì)算開(kāi)源框架Hadoop-入門實(shí)踐_第5頁(yè)
已閱讀5頁(yè),還剩23頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

阿里軟件開(kāi)發(fā)平臺(tái)服務(wù)框架(ASF)設(shè)計(jì)與實(shí)現(xiàn),服務(wù)集成平臺(tái)(SIP)設(shè)計(jì)與實(shí)現(xiàn)。沒(méi)有什么擅長(zhǎng)或者精通,工作到現(xiàn)在唯一提升的就是學(xué)習(xí)能力和速度。PI析內(nèi)容提供給分布式計(jì)算系統(tǒng)作為輸入,就可以得到分布式計(jì)算后的結(jié)果。場(chǎng)景(日志分析和索引建立就是兩大應(yīng)用場(chǎng)景)。供了底層支持。到執(zhí)行方式。小數(shù)據(jù)傳輸?shù)膲毫τ泻艽蟮膸椭?。后面?huì)具體提及這些部分的細(xì)節(jié)。1.對(duì)于整個(gè)集群有單一的命名空間。2.數(shù)據(jù)一致性。適合一次寫入多次讀取的模型,客戶端在文件沒(méi)有被成功創(chuàng)建之前無(wú)3.文件會(huì)被分割成多個(gè)文件塊,每個(gè)文件塊被分配存儲(chǔ)到數(shù)據(jù)節(jié)點(diǎn)上,而且根據(jù)配置制文件塊來(lái)保證數(shù)據(jù)的安全性。作是分布式文件系統(tǒng)中的管理者,主要負(fù)責(zé)管理文件系統(tǒng)的命名空間、集群配置信息式文件系統(tǒng)文件的應(yīng)用程序。這里通過(guò)三個(gè)操作來(lái)說(shuō)明他們之間的交互關(guān)系。d最后再說(shuō)一下HDFS的幾個(gè)設(shè)計(jì)特點(diǎn)(對(duì)于框架設(shè)計(jì)值得借鑒):e,在讀取的時(shí)候需要交驗(yàn)后再讀入。式允許修改的出錯(cuò)提示,只需要等待一會(huì)兒即可。布式計(jì)算的高效性。布式計(jì)算的作用):。。海量數(shù)據(jù)被分割于多個(gè)節(jié)點(diǎn),然后由每一個(gè)節(jié)點(diǎn)并行計(jì)算,將得出的結(jié)果分布式計(jì)算圖,在不同階段都有不同產(chǎn)出,同時(shí)并行和串行結(jié)合的計(jì)算也可以很,同時(shí)有一些細(xì)節(jié)需要注意的也說(shuō)明一下,其實(shí)也就是這些細(xì)節(jié)會(huì)讓人摸索增加機(jī)器配置。wenchuhadoopastersslaveslversionmlstylesheettypetextxslhrefconfigurationxslPutsitespecificpropertyoverridesinthisfile>口valuehdfs.46:54310/</value>valuehdfs.46:54311/</value>e名其妙的DataNode啟動(dòng)不了,就刪除此文件中homewenchuhadooptmpvaluexmvalueuevaluecriptionThedefaultblocksizefornewfilesdescriptin#Thejavaimplementationtouse.Required.exportJAVAHOME=/usr/ali/jdk1.5.0_10astersscprootmasterIProotsshidrsapub/root/.ssh/46_rsa.dk體的內(nèi)容根據(jù)你的安裝路徑修改,這步只是為了方便使用)exportHADOOP_HOME=/home/wenchu/hadoop-0.17.1HPATHHADOOPHOMEbinomewenchutestintestinhomewenc經(jīng)驗(yàn)總結(jié)和注意事項(xiàng)(這部分是我在使用過(guò)程中花了一些時(shí)間走的彎路):e果集群中如果有兩臺(tái)機(jī)器的機(jī)器名如果重復(fù)也會(huì)出現(xiàn)問(wèn)題。oo。Hadoop中的命令(Command)總結(jié)Hadoopdfs–rmrxxx就是刪除目錄,還有很多命令看看就很容易上手;Hadoopbalancer是前面提到的均衡磁盤負(fù)載的命令。代碼類圖1.在分布式環(huán)境中客戶端創(chuàng)建任務(wù)并提交。業(yè)務(wù)場(chǎng)景和代碼范例有去細(xì)分很多類,將所有的類都?xì)w并于一個(gè)類便于說(shuō)明問(wèn)題。中提到的角色職責(zé)。具體地看看幾個(gè)類和方法的代碼片斷:MapClassblicstaticclassMapClassextendsMapReduceBaseongWritableTextTextLongWritable{publicvoidmapLongWritablekeyTextvalue,OutputCollectorongWritableoutputReporterreportertion{lllineequalsStringwordslinesplit,");dsnullwordslengthingappidwordsingapiNamewordsLongWritablerecbytesnewLongWritableLongparseLongwTextrecordnewText);recordsetnewStringBufferflow).append(appid)append"::").append(apiName).toString());rterprogresscordclearrecordsetnewStringBuffercount::").append(appid).appedpiNametoStringutputcollectrecordnewLongWritable}}LogAnalysiser::PartitionerClasspublicstaticclassPartitionerClassimplementsPartitionerTextitable{publicintgetPartitionTextkeyLongWritablevalue,intnumtions{計(jì)分配到不同的ReducegstartsWithflowreturn;return1;return;}publicvoidconfigureJobConfjob){}}LogAnalysiser::CombinerClassLogAnalysiser::ReduceClassblicstaticclassReduceClassextendsMapReduceBaseextLongWritableTextLongWritable{publicvoidreduceTextkeyIteratorLongWritable>values,tputCollectorTextLongWritableoutputReporterrterthrowsIOException{TextnewkeynewText);newkeysetkeytoStringsubstringkeytoString().indexOLongWritableresultnewLongWritable;{tmptmpvaluesnextget有收到報(bào)告會(huì)認(rèn)為TaskTracker已經(jīng)失效,因此定時(shí)報(bào)告一下{terrterprogress}}sultsettmpoutputcollectnewkeyresult的匯總結(jié)果}}publicstaticvoidmainString]args){{rgsExceptione{race}}publicstaticvoidrunStringargs)throwsException{nullargslength{stemoutprintlnneedinputpathandoutputp}ringinputpathargsringoutputpathargsringshortinargsringshortoutargsnindexOfFileseparatorinsubstringshortinlastIndexOparatorutindexOfFileseparatorutsubstringshortoutlastIndeparatorpleDateFormatformaternewSimpleDateFormatyyyddshortoutnewStringBuffershortoutappendformaterformatnewDatetoStringsWithhortintsWithshortoutuserrootshortintuserrootshortoutFileinputdirnewFileinputpath);FileoutputdirnewFileoutputpath);xistsinputdirisDirectory{System.out.println("inputpathnotexistorisntdir}{ewFileoutputpathmkdirs}JobConfconfnewJobConfnewConfiguration,LogAnaFileSystemfileSysFileSystemget(conf);scopyFromLocalFilenewPathinputpathnewPaobNameanalysisjobetOutputValueClassLongWritableclassapperClassMapClassclassbinerClassCombinerClassclasseducerClassReduceClassclassartitionerClassPartitionerClassclassconfsetmapredreducetasks強(qiáng)制需要有兩個(gè)FileOutputFormatsetOutputPathconfnewPathshortouDatestartTimenewDate();SystemoutprintlnJobstarted+startTime);ientrunJobconfDateendtimenewDate();SystemoutprintlnJobended+end_time);SystemoutprintlnThejobtook(end_time.getTimestartTimegetTime/1000+"seconds.");的臨時(shí)文件scopyToLocalFilenewPathshortoutnewPathoutpathysdeletenewPathshortintrueysdeletenewPathshortouttrue}publicclassExampleDriver{publicstaticvoidmainStringargv]){ProgramDriverpgdnewProgramDriver);try{pgdaddClassanalysislogLogAnalysiserclass,"Amap/reduceprogramthatanalysislog.");ddriverargv}hrowableerace}}}:hadoopjaranalysiserja

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論