瓒h皥Hbase鏋舵瀯

Posted Java3y

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了瓒h皥Hbase鏋舵瀯相关的知识,希望对你有一定的参考价值。


馃憠搂鍥㈢粨鍔涢噺澶?/span>

鍘熷绀句細锛岀敱鑻ュ共琛€缂樼浉杩戠殑瀹楁棌銆佹皬鏃忕粨鍚堣捣鏉ラ泦浣撶敓娲伙紝杩欏氨鏄?/span>
閮ㄨ惤銆傛渶楂橀棰嗗氨鏄?/span>閰嬮暱锛屾澶栬繕鍙兘浼氭湁鍐涗簨棣栭锛屼粬浠竴璧风箒琛嶇敓鎭€?br>
鍒颁簡鍘熷绀句細鏈湡锛岄绻佹垬浜夛紝鑻ュ共涓翰杩戠殑鎴栨湁鍏卞悓鍒╃泭鐨勯儴钀斤紝缁撴垚鏆傛椂鐨勬垨姘镐箙鐨?/span>鑱旂洘锛屼竴璧峰幓鍜屽埆浜篜K锛岃繖灏辨槸閮ㄨ惤鑱旂洘銆?br>
閮ㄨ惤鑱旂洘鐨勬€ц川鍜岄儴钀界浉鍚岋紝瀹冧滑涔熸湁鏈€楂橀棰嗭紝鏉冨埄鏈哄叧绛夈€備腑鍥藉彜绫嶈杞界殑榛勫笣銆佽毄灏わ紝浠ュ強灏с€佽垳銆佺閮芥槸閮ㄨ惤鑱旂洘鐨勯棰嗐€?br>
閫氳繃杩欎釜浜嬫儏锛岃嚦灏戣浣忎袱鐐癸細绗竴涓槸鍥㈢粨鍔涢噺澶с€傝繖寰堟樉鐒躲€傜浜屼釜鏄浜や笂姣旇緝鏈夊悕鐨勪竴鍙ヨ瘽锛屸€滄病鏈夋案鎭掔殑鏁屼汉锛屽彧鏈夋案鎭掔殑鍒╃泭鈥濄€?br>
馃憠搂鎶婇儴钀芥惉杩涜绠楁満

璁$畻鏈虹殑鍘嗗彶鎵嶅嚑鍗佸勾鑰屽凡锛屼笌浜虹被绀句細鐩告瘮锛岄偅鏄揣鐪熶环瀹炵殑鈥滃悗鐢熲€濄€傝櫧鐒剁幇鍦ㄨ绠楁満宸茬粡寰堝帀瀹充簡锛屼絾鏄崟鍙扮殑鑳藉姏鎬绘槸鏈変笂闄愮殑銆?br>
鍘熷绀句細閮界煡閬撳洟缁撳姏閲忓ぇ锛岄偅灏辫璁$畻鏈哄洟缁撹捣鏉ュ惂銆傛妸鑻ュ共鍙拌绠楁満閫氳繃缃戠粶缁撳悎璧锋潵锛屽氨褰㈡垚浜?/span>
璁$畻鏈虹晫鐨勯儴钀?/span>锛堟垨閮ㄨ惤鑱旂洘锛夈€?br>
鎴戜滑涔熻閫夊嚭涓€鍙拌绠楁満褰撯€滈厠闀库€濆晩锛屼簬鏄閫夊嚭鏉ョ殑閭d竴鍙伴€氬父绉颁负
Master鑺傜偣锛屽墿浣欑殑绉颁负Slave鑺傜偣銆傚氨鏄垜浠父璇寸殑Master/Slave銆備絾鏄疭lave鏈夊ゴ闅剁殑鎰忔€濓紝浼氳涓€浜涘浗瀹跺弽瀵癸紝鎵€浠ュ氨鏈変簡鍙﹀涓€濂楀彨娉曪紝Leader/Follower锛屼腑鏂囩О涓?/span>涓?/span>/浠?/span>銆?br>
杩欎釜璁$畻鏈虹晫鐨勯儴钀藉氨绉颁负
闆嗙兢銆?br>
馃憠搂Hbase闆嗙兢

Hbase鐨勮璁$洰鏍囧氨鏄捣閲忓瓨鍌ㄨ兘鍔涳紝鎵€浠ュ畠蹇呴』鏄竴涓?/span>
闆嗙兢銆傚畠鐨勨€滈厠闀库€濆氨绉颁负Master鑺傜偣锛屽墿浣欑殑姣忎釜鑺傜偣灏辩О涓?/span>Region Server銆?br>
閰嬮暱涓轰簡鏇村ソ鍦扮鐞嗘湰閮ㄨ惤浜哄憳锛屼竴鑸繕浼氳缃竴涓渶楂?/span>鍐涗簨棣栭锛屾潵杈呭姪鑷繁銆傚彲浠ョ悊瑙d负鎴戜滑甯歌鐨?/span>鍐涘笀銆?br>
Hbase闆嗙兢涔熸湁鑷繁鐨勨€滃啗甯堚€濓紝瀹冨氨鏄?/span>ZooKeeper銆俍ooKeeper鏈韩涔熸槸涓€涓?/span>闆嗙兢銆?br>
閰嬮暱杩欎釜瑙掕壊鏄緢閲嶈鐨勶紝涓€鏃︽垬姝伙紝鏁翠釜閮ㄨ惤灏?/span>缇ら緳鏃犻锛屽鏄撳唴璁э紝鎵€浠ュ繀椤荤珛椹?/span>鍐嶉€夊嚭涓€涓?/span>閰嬮暱銆?br>
閰嬮暱闇€瑕佸叿鏈夊緢寮虹殑鑳藉姏锛屼笉鏄皝閮借兘褰撶殑銆傛墍浠ュ钩鏃堕渶瑕佷竴涓?/span>鍚庡閰嬮暱鏃舵椂鍒诲埢鍊欑潃锛屼互闃蹭笉娴嬨€傚叾瀹炲氨鏄釜澶囪儙銆?br>
鎵€浠base涓甯哥殑閭d釜Master鑺傜偣绉颁负
Active Master鑺傜偣锛岃嚦灏戣繕鏈変竴涓悗澶囩殑Master鑺傜偣绉颁负Backup Master鑺傜偣銆傝繖涓や釜Master鑺傜偣涔嬮棿缁忓父浜掗€氭湁鏃?/span>锛屼繚鎸?/span>淇℃伅涓€鑷?/span>銆?br>


瓒h皥Hbase鏋舵瀯


涓€鏃﹁繖涓狝ctive Master鑺傜偣鑻卞媷灏变箟鍚庯紝鐢扁€滃啗甯堚€漐ooKeeper璐熻矗浠嶣ackup Master鑺傜偣涓€夊嚭涓€涓垚涓烘柊鐨勮€佸ぇ銆傚洜涓哄畠鏈潵灏辨槸鍚庡寰呭懡鐘舵€侊紝鎵€浠ヤ竴涓婃潵灏卞彲浠ユ帴鏇垮伐浣滐紝娌℃湁鈥滃疄涔犳湡鈥濈殑銆?br>
Master鑺傜偣涓昏璐熻矗
绠$悊绫?/span>鐨勫伐浣滐紝鍏朵綑鐨凴egion Server鑺傜偣鍒欎富瑕佽礋璐?/span>骞叉椿浜嗭紝濡傛暟鎹殑璇?鍐欑瓑銆?br>
馃憠搂鍖栨暣涓洪浂

Hbase鏄互琛岀殑褰㈠紡瀹炵幇闈㈠悜鍒楃殑瀛樺偍锛屽叾瀹炶繕鏄?/span>
琛屽瓨銆傝兘澶熸敮鎸?/span>鏁板崄浜胯锛屽彲瑙佸畠鏄竴涓?/span>闈炲父闀?/span>鐨勮〃銆?br>
瀹為檯鐢熸椿涓紝瓒呴暱鐗╀綋鐨勫姞宸ャ€佽繍杈撻兘寰堥夯鐑︼紝鎵€浠ヤ汉浠氨
鎴垚涓€娈典竴娈?/span>鐨勶紝鍒嗘澶勭悊濂斤紝鏈€鍚庡啀鎷兼帴鍒颁竴璧枫€?br>
閲囩敤鐩稿悓鐨勬柟娉曪紝鎶奌base鐨勮秴闀胯〃鍒嗘垚鑻ュ共娈碉紝姣忎竴娈电О涓轰竴涓?/span>Region銆傜浉褰撲簬浼犵粺鍏崇郴鍨嬫暟鎹簱鐨?/span>妯悜鍒嗚〃銆?br>


瓒h皥Hbase鏋舵瀯


鎵€鏈夌殑Region鎷兼帴璧锋潵灏卞舰鎴愪簡Hbase涓殑涓€涓?/span>瀹屾暣琛?/span>銆傚氨鍍忔墍鏈夎溅鍘㈡嫾鎺ヨ捣鏉ュ氨褰㈡垚浜嗕竴鍒楀畬鏁寸殑鍒楄溅涓€鏍枫€?br>
Hbase鏄潰鍚戝垪鐨勶紝鎵€浠ュ湪瀛樺叆涓€琛屾暟鎹椂锛?/span>鏌愪簺鍒楁棌鍙互瀹屽叏娌℃湁鏁版嵁銆傛瘮濡備竴涓垰姣曚笟鐨勫鐢熷氨娌℃湁宸ヤ綔缁忓巻锛岄偅宸ヤ綔缁忓巻杩欎釜鍒楁棌灏辨槸绌虹殑銆?br>
鍙鍒楁棌涓庡垪鏃忎箣闂寸殑
宸埆鏈夋椂闈炲父澶?/span>锛屾墍浠?/span>瀛樺偍鏃朵篃鏄垎寮€鐨?/span>锛屽嵆涓€涓垪鏃忎竴涓瓨鍌紝鎶婅繖涓瓨鍌ㄧО涓?/span>Store銆?br>
鎵€浠ヤ竴涓猂egion閲屽彲浠ユ湁
涓€鍒板涓?/span>Store銆?/span>


瓒h皥Hbase鏋舵瀯



馃憠搂瀛樺偍缁撴瀯

Hbase闆嗙兢涓礋璐e疄闄呮暟鎹伐浣滅殑鏄緢澶氱殑
Region Server鏈嶅姟鍣ㄣ€傛瘡涓〃浠庨€昏緫涓婅鍒囧垎涓哄緢澶?/span>Region銆?br>
寰堟槑鏄炬渶鍚庤鎶婅繖浜?/span>Region鍒嗛厤鍒?/span>杩欎簺Region Server鏈嶅姟鍣ㄤ笂锛岃繖涓垎閰嶇殑宸ヤ綔鏄敱Master鑺傜偣瀹屾垚鐨勩€?br>


瓒h皥Hbase鏋舵瀯


Hbase鐨勮璁$洰鏍囧氨鏄鏀寔瀹炴椂鐨勮鍐?/span>銆傛墍浠ュ啓鍏ョ殑閫熷害蹇呴』瑕佸揩锛岃繕鏈変釜闅愬舰鐨勫墠鎻愬氨鏄暟鎹篃瑕佸畨鍏ㄦ墠琛屻€?br>
鏁版嵁鍐欏叆
鍐呭瓨鐨勯€熷害闈炲父蹇紙鎯虫兂Redis锛夛紝浣嗗彧鏈夊啓鍏?/span>纾佺洏鎵嶇畻瀹夊叏銆?br>
涓€涓猂egion Server涓婃湁寰堝Region锛屽鏋滄湁澶ч噺骞跺彂鍐欏叆锛岃繖浜涙暟鎹渶缁堣惤鍒扮鐩樹笂鐨勪笉鍚屼綅缃笂锛屽厜纾佸ご
鏉ユ潵鍥炲洖鐨勫閬撴椂闂?/span>灏辨槸涓€涓潪甯稿ぇ鐨勫紑閿€銆傚墿涓嬬殑灏辨槸瀹為檯鍐欐暟鎹殑鏃堕棿浜嗐€?br>
馃憠搂濡備綍浼樺寲

澶嶅埗鎴栧垹闄ゅ緢澶氬皬鏂囦欢鏃讹紝闈炲父鑰楁椂銆傚鏋滄妸瀹冧滑鎵撳寘鎴愪竴涓帇缂╂枃浠讹紝鍐嶅鍒舵垨鍒犻櫎锛屼細蹇緢澶氥€?br>
鎵€浠ュ彲浠ラ€氳繃
鍑忓皯鍐欏叆鐨勬枃浠朵釜鏁?/span>鏉ヤ紭鍖栥€傚鏋滄垜浠彧鍐欎竴涓枃浠讹紝涓旀瘡娆¢兘鍦ㄦ枃浠舵湯灏捐拷鍔狅紝杩欏簲璇ユ渶澶ч檺搴︾殑鍑忓皯浜嗙澶寸殑绉诲姩銆?br>
杩欑鏂瑰紡鍦℉base涓彨鍋?/span>棰勫啓鏃ュ織锛屽嵆Write Ahead Log锛?/span>WAL锛夈€傛墍鏈夌殑鍐欏叆鎿嶄綔鍙鎶婃暟鎹拷鍔犲埌杩欎釜鏃ュ織鏂囦欢涓氨绔嬪嵆杩斿洖銆?br>
涓€涓猂egion Server鏈嶅姟鍣ㄥ彧鏈?/span>涓€涓?/span>杩欐牱鐨刉AL鏂囦欢锛岃鏈嶅姟鍣ㄤ笂鐨勬墍鏈塕egion浠ュ強瀹冮噷闈㈢殑鎵€鏈塖tore鍏变韩銆?br>
棰勫啓鏃ュ織鐨勬暟鎹牸寮忓苟涓嶉€傚悎杩涜鏈€缁堢殑瀛樺偍锛屾墍浠ュ湪Store閲岄潰杩樻湁涓€涓?/span>MemStore杩欐牱鐨勬暟鎹粨鏋?/span>椹荤暀鍦ㄥ唴瀛橀噷锛屼細鏀堕泦鎵€鏈夊啓鍏ョ殑鏁版嵁锛屼笖鎸塺ow key宸叉帓搴?/span>銆?br>


瓒h皥Hbase鏋舵瀯


褰撴煇浜涙潯浠惰婊¤冻鏃讹紝MemStore涓殑鏁版嵁浼氳flush鍒扮鐩樹笂杩涜鎸佷箙鍖栵紝鏈€缁堣繖浜涙暟鎹互StoreFile鐨勫舰寮忓瓨鍌ㄥ埌HDFS涓€?/span>


瓒h皥Hbase鏋舵瀯


鎺ㄨ崘闃呰锛?/span>




瓒h皥Hbase鏋舵瀯


200澶氱瘒 鍘熷垱 鎶€鏈枃绔?/strong>
娴烽噺瑙嗛璧勬簮
绮剧編鑴戝浘
闈㈣瘯棰?/strong>

闀挎寜鎵爜鍙叧娉ㄨ幏鍙?/strong> 

娆㈣繋鍏虫敞鐐逛釜鍐嶇湅


以上是关于瓒h皥Hbase鏋舵瀯的主要内容,如果未能解决你的问题,请参考以下文章

redis鏋舵瀯

鑲℃潈鏋舵瀯璁捐鐨勭洰鐨勫拰鍘熷垯

P9 澶т浆鍘熷垱鈥斺€斿洓涓楠わ紝杞绘澗鎼炲畾鏋舵瀯璁捐

鎬庝箞鐢ˋPI缃戝叧鏋勫缓寰湇鍔★綔鏋舵瀯

銆岀81鏈熴€? 鏋舵瀯鍒嗘瀽 -Tomcat 璇锋眰娴佺▼

璇磋淇濆崟鏋舵瀯璁捐