Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HDFS RAID
Search
jiangbo
December 21, 2012
Programming
0
3.9k
HDFS RAID
an introduction of HDFS RAID
jiangbo
December 21, 2012
Tweet
Share
More Decks by jiangbo
See All by jiangbo
HDFS
jiangbo
0
190
Memcached内存管理
jiangbo
1
1.6k
awk
jiangbo
4
310
vim
jiangbo
8
500
Other Decks in Programming
See All in Programming
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
7
1.6k
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2k
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
390
CSC509 Lecture 02
javiergs
PRO
0
410
どの様にAIエージェントと 協業すべきだったのか?
takefumiyoshii
2
630
Serena MCPのすすめ
wadakatu
4
940
CSC509 Lecture 06
javiergs
PRO
0
260
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
130
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
250
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
390
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
520
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
450
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
We Have a Design System, Now What?
morganepeng
53
7.8k
Making Projects Easy
brettharned
119
6.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
Building an army of robots
kneath
306
46k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
A better future with KSS
kneath
239
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
Optimizing for Happiness
mojombo
379
70k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Transcript
HDFS RAID ᇙത Friday, December 21, 12
Outline • Overview • Some detail • How to use
Friday, December 21, 12
Why? • $$$$$......and $$$$$.... Friday, December 21, 12
How? • 䫩খ෭ຊ+҆શੑෆ߱=Erasred Code Friday, December 21, 12
Overview Friday, December 21, 12
DRFS • ༻Raidम䐾ޭೳแྃHDFSతDFS • 读औHDFSதblockਾੋ发ੜ CorruptionException҃DecomissionException时 ࠜਾparityจ݅对䇗ৗblock进ߦम䐾 Friday, December 21,
12
RaidShell • ҰClientཧ۩ɼఏڙraidFileɼunraidɼ fixBlock, checkStatusޭೳ • ௨过RPC请ٻRaidNodeɼNN节发ى请ٻ Friday, December 21,
12
RaidNode • DRFSதআNNɼJT֎ୈࡾMaster • 维护Ұ组తdaemon线ఔɼࠜਾ༻户ఏަతraid 请ٻʢraid policyʣraidɼfixɼpurge֤㜎 ૢ࡞ Friday, December
21, 12
Threads on RaidNode • TriggerMonitorɿ֩৺线ఔɼࠜਾpolicyஔ调raid • BlockFixerɿम䐾corruptจ݅తworker线ఔ • BlockCopierɿम䐾decomissionจ݅తworker线ఔ •
PurgeParityThreadɿਗ਼ཧݽၰparityจ݅త线ఔ • PlacementThreadɿࢄdatanode্过ूதతparity blockత线ఔ • HarThreadɿক过ظతparity进ߦharҎ䫩গparityจ݅త线ఔ Friday, December 21, 12
Some detail • raid file • fix file Friday, December
21, 12
Raid File • hadoop raidshell -raidFile /path • TriggerMonitor Friday,
December 21, 12
Friday, December 21, 12
RaidNode.doRaid Friday, December 21, 12
Encode Friday, December 21, 12
Erasred Code • RS: 10:4 • XOR: 10:1 Friday, December
21, 12
Fix File • DRFS readั获䇗ৗ • BlockIntegrityMonitor检查౸䇗ৗจ݅ Friday, December 21,
12
DRFS read Friday, December 21, 12
BlockIntegrityMonitro • local • dist • sorry...图ྃ... Friday, December 21,
12
Local LocalBlockIntegrity线ఔత֩৺ੋपظ调༻doFixํ๏म䐾corruptจ݅ɼओཁ ྲྀఔԼɿ 1. ௨过DFSck获औcurrputจ݅৴ଉʢHTTP访问ʣ 2. 过滤ᎃෆೳ伭䐾తcorruptจ݅ʢ༗parityจ݅తʣ 3. কcorrputతจ݅ഉংɼഉং规则Լ ◦
parityจ݅优ઌɼsourceจ݅ࡏ ◦ parityจ݅தcodec.priorityߴతࡏઌʢcodec.priority௨过JSONத coder_priorityஔʣ 4. 对ഉং߸తcorruptจ݅ྻදґ࣍௨过BlockRecontsturerདྷ伭䐾ɻ Friday, December 21, 12
Dist 1. 检查લਖ਼ࡏ运ߦతम䐾jobɼՌલjobቮ经େဋjob্ݶɼ则೭લత job运ߦʢ该্线ՄҎ௨过raid.blockfix.maxpendingjobsདྷஔɼᘍ认ੋ100Lʣ 2. ௨过DFSck获औ损ᆀతจ݅৴ଉɼblockfixer线ఔ获औcorruptจ݅৴ଉɼ blockCopier获औdecomissionจ݅৴ଉ 3. 计ࢉ获ಘత损ᆀจ݅త优ઌ级 4.
ক计ࢉ优ઌ级తจ݅ྻද҈优ઌ级ഉংɼ࡞为ࢀ构ݐम䐾Jobɻ 5. Jobత输ೖੋॴ༗धཁम䐾తจ݅pathతsequence fileɻձࠜਾ raid.blockfix.filespertaskஔత值进ߦsyncɼଈࡏjobతsplit阶ஈձ҈র该值设ஔ త进ߦsplitɼᘍ认ੋ20 6. JobతMapperओཁੋ௨过Reconstruterࡏtaskص্㠳应จ݅త伭䐾ɻ Friday, December 21, 12
优ઌ级计ࢉ 1. corrputจ݅త优ઌ级Լ(R为จ݅෭ຊɼC为该จ݅corrputత block)ɿ ◦ ᘍ认为LOW ◦ R>1 && C>0时ɿ
HIGH ◦ R==1 && C>1时ɿ HIGH ◦ parityfile corrput && C>0时ɿ HIGH 2. decomission优ઌ级计ࢉ规则ԼʢD为decomissionతblock): ◦ ᘍ认为LOW ◦ D>4时ɿ HIGH Friday, December 21, 12
BlockReconstructor • BlockIntegrityMonitorRaidShell对จ݅తम䐾࠷终௨过 BlockReconstructorདྷɻ • BlockReconstructorम䐾จ݅过ఔओཁ为ࡾ㜎ɿHar parityจ݅ɼparity จ݅ݯਾจ݅ɻ Friday, December
21, 12
Har parity file 1. 获औharจ݅తجຊ৴ଉٴindex 2. 获औharจ݅தతlost blockɼ对㑌block进ߦԼ处ཧɿ 3. ࡏຊจ݅ܥ统创ݐ该blockత临时จ݅ɼ
4. 对该block㐪ٴతॴ༗parityจ݅ɼ获औ对应తsourceจ݅ɼ௨过 Encoderॏ৽encodeɼࡏຊੜparityɻ 5. কຊੜతblockਾ发ૹ౸Ұdatanode্ɼdatanodeత选औ 规则ੋဓू܈தআݪblockॴଐ节֎ਵص选औҰɻ发ૹ过ఔಉ 时ੜblockతmetaจ݅ɻ Friday, December 21, 12
Parity File parityจ݅తम䐾处ཧ૬对简单ɿ 1. ࡏຊ࣍创ݐlost blockత临时จ݅ 2. 获औparityจ݅తݯจ݅ɼ௨过Encoderॏ৽encodeɼࡏຊ ੜparityจ݅తblock 3.
选औҰdnʢ选औ规则har parityจ݅म䐾Ұகʣɼক blockਾ发ૹ౸该dn্ɼኂಉ时ੜmetaจ݅ Friday, December 21, 12
ਾจ݅ ݯจ݅త伭䐾༩parityจ݅తम䐾૬ɼੋҰdecode过ఔɿ 1. 对ဋfileத丢ࣦత㑌block执ߦम䐾ૢ࡞ 2. ࡏຊ创ݐblockత临时จ݅ 3. ௨过Decoder伭䐾blockਾ 4. 选औҰtarget
dnɼকblockਾ发ૹ给target dnɼኂಉ时ੜmeta จ݅ɻ Friday, December 21, 12
Decoder Friday, December 21, 12
How to use http://wiki.aliyun-inc.com/projects/apsara/wiki/Yunti1/HDFS-Raid-deploy http://wiki.apache.org/hadoop/HDFS-RAID Friday, December 21, 12
Ұ问题 • େྔจ݅ڊܕจ݅తraid Friday, December 21, 12
Resouces http://wiki.apache.org/hadoop/HDFS-RAID http://hadoopblog.blogspot.com/2009/08/hdfs-and-erasure-codes-hdfs-raid.html http://jiangbo.me/blog/2012/12/21/hdfs-raid/ Friday, December 21, 12
THX Friday, December 21, 12