ÔÚ´«Í³µÄApache Hadoop¼¯ÈºÏµÍ³ÖУ¬¼ÆËãºÍ´æ´¢×ÊÔ´ÊǽôÃÜñîºÏµÄ£¬HDFSΪ´óÊý¾Ý´æ´¢´øÀ´±ãÀûµÄͬʱ£¬Ò²ÃæÁÙ×ÅһЩÌôÕ½£º
µ±´æ´¢¿Õ¼ä»ò¼ÆËã×ÊÔ´²»×ãʱ£¬Ö»ÄÜͬʱ¶ÔÁ½Õß½øÐÐÀ©ÈÝ¡£¼ÙÉèÓû§¶Ô´æ´¢×ÊÔ´µÄÐèÇóÔ¶´óÓÚ¶Ô¼ÆËã×ÊÔ´µÄÐèÇó£¬ÄÇôͬʱÀ©ÈݼÆËãºÍ´æ´¢ºó£¬ÐÂÀ©ÈݵļÆËã×ÊÔ´¾Í±»ÀË·ÑÁË£¬·´Ö®£¬´æ´¢×ÊÔ´±»ÀË·Ñ¡£
Õâµ¼ÖÂÀ©Èݵľ¼ÃЧÂʽϵͣ¬¶îÍâÔö¼Ó³É±¾¡£¶ø¶ÀÁ¢À©Õ¹µÄ¼ÆËãºÍ´æ´¢Ôò¸ü¼ÓÁé»î£¬Í¬Ê±¿ÉÏÔÖø½µµÍ³É±¾¡£
ÏÖÔÚHadoop²ÉÓôæËã·ÖÀëµÄ¼Ü¹¹µÄÇ÷ÊÆÔ½À´Ô½Ã÷ÏÔ¡£
XSKY HDFS ClientÊÇΪXEOS´æ´¢¼¯ÈººÍHadoop¼ÆË㼯ȺÁ¿Éí´òÔìµÄÁ¬½ÓÆ÷¡£Í¨¹ýXSKY HDFS
Client£¬HadoopÓ¦ÓÿÉÒÔ·ÃÎÊ´æ´¢ÔÚXEOSÖеÄËùÓÐÊý¾Ý¡£
µ«ÊÇ£¬ÔÚÒýÈëXEOS´æ´¢ºó£¬»á³öÏÖÔÓÐHDFSÓëXEOS¹²´æµÄÇé¿ö£¬ÈçºÎ½«Á½Ì×´æ´¢¼¯Èº¶¼ÀûÓÃÆðÀ´ÊÇÐèÒª½â¾öµÄÎÊÌâ¡£
01Êý¾Ý¿ç¼¯Èº¿½±´
Ò»°ãÇé¿öÏ£¬¼ÆËãÓ¦ÓÃÐèÒª·ÃÎʵÄÊý¾Ý£¬Èç¹û±£´æÔÚ²»Í¬µÄ¼¯ÈºÖУ¬ÄÇôӦ¸Ã½«ÆäÖÐÒ»¸ö¼¯ÈºµÄÊý¾Ý¿½±´µ½ÁíÒ»¸ö¼¯ÈºÉÏ¡£Ò»°ãÇé¿öÏÂʹÓÃHadoop×Ô´øµÄDistCp¹¤¾ß£¬¶ÔÊý¾Ý½øÐп缯ȺµÄ¿½±´¡£
ÕâÖÖ·½Ê½ËäÈ»ÔÚÒ»¶¨³Ì¶ÈÉÏ¿ÉÒÔ½â¾öÊý¾ÝºÏ²¢µÄÎÊÌ⣬µ«Èç¹ûÊý¾ÝÁ¿±È½Ï´ó£¬²¢ÇÒ»ú·¿´ø¿íÓÐÏÞÖƵÄÇé¿öÏ£¬¿ÉÄÜ¿½±´Êý¾ÝµÄʱ¼ä»á·Ç³£³¤¡£»¹ÓÐÒ»¸ö¾ÍÊÇÔÚ¿½±´¹ý³ÌÖÐÔʼÊý¾Ý·¢Éú¸Ä¶¯£¬¾Í»¹ÐèÒª¿¼ÂÇÔöÁ¿Í¬²½µÄÎÊÌâ¡£
02Áª°îHDFSºÍViewFS
ÔÚHadoop
2.x·¢ÐаæÖÐÒýÈëÁËÁª°îHDFS¹¦ÄÜ£¬ÆÚÍû¿ÉÒÔ½â¾öNameNodeµÄÄÚ´æÎÊÌâ¡£Áª°îHDFSÔÊÐíϵͳͨ¹ýÌí¼Ó¶à¸öNameNodeÀ´ÊµÏÖÀ©Õ¹£¬ÆäÖÐÿ¸öNameNode¹ÜÀíÎļþϵͳÃüÃû¿Õ¼äÖеÄÒ»²¿·Ö¡£
µ«ÊÇ£¬ÔÚʵ¼ÊÓ¦ÓÃÖУ¬ÏµÍ³¹ÜÀíÔ±ÐèҪά»¤¶à¸öNameNodes£¨ËùÓÐNameNode¶¼ÐèÒª¸ß¿ÉÓ㩺͸ºÔؾùºâ·þÎñ£¬ÕâÓÖÔö¼ÓÁ˹ÜÀí³É±¾¡£ËùÒÔHDFSµÄÁª°î·½°¸²¢Ã»Óб»Éú²ú»·¾³Ëù²ÉÓá£
ÔÚÌṩÁª°îHDFS·½°¸Í¬Ê±£¬Hadoop 2.x»¹ÌṩÁËViewFS£¬ÓÃÀ´¹ÜÀíËùÓжà¸öÃüÃû¿Õ¼äÊÓͼ¡£
ËäÈ»Áª°îHDFS·½°¸²¢Ã»Óб»´ó¹æÄ£Ó¦Ó㬵«ViewFSÈ´¿ÉÒÔÓÃÀ´½â¾öXEOSÓëHDFS¹²´æÎÊÌâ¡£
03ViewFSµÄʵÏÖ
ViewFSÈ«³ÆÊÇViewFileSystem£¬Ëü²»ÊÇÒ»¸öеÄÎļþϵͳ£¬Ö»ÊÇÂß¼ÉϵÄÒ»¸öÊÓͼÎļþϵͳ£¬ËüʵÏÖÁ˱ê×¼µÄHadoop
FileSystem½Ó¿Ú¡£µ«ÊÇ£¬ÕæʵµÄÇëÇó´¦Àí»¹ÊÇÔÚ¸÷×ÔÕæʵµÄ´æ´¢¼¯ÈºÉÏ¡£
ViewFS»áά»¤Ò»¸ömount-table£¬Ö÷ÒªÊÇviewfsµÄÂ߼Ŀ¼Óëʵ¼Êµ×²ã´æ´¢µÄÓ³Éä¹Øϵ¡£ÔÚ½ÓÊÕµ½Ó¦Óõĵ÷ÓÃʱ£¬ViewFS»á½âÎöÓû§µÄ·ÃÎÊÇëÇ󣬲¢Í¨¹ýmount-tableÕÒµ½¶ÔÓ¦µÄµ×²ã´æ´¢Ä¿Â¼£¬×ª·¢ÏàÓ¦µÄÇëÇ󵽵ײã´æ´¢¡£
ViewFS»á°ÑËùÓÐÓ¦ÓòãµÄFileSystemµ÷ÓÃ͸´«µ½µ×²ãÕæʵÎļþϵͳÖС£ÓÉÓÚViewFsʵÏÖÁËHadoopÎļþϵͳ½Ó¿Ú£¬Òò´ËʹÓÃËü͸Ã÷µØÔËÐÐHadoop¹¤¾ß¡£ÀýÈ磬ËùÓÐshellÃüÁ¿ÉÒÔÓëHDFSºÍ±¾µØÎļþϵͳһÆðʹÓÃViewFS¡£
ÔÚ¼¯ÈºµÄcore-siteÅäÖÃÖУ¬fs.defaultFS±»ÉèÖÃΪViewFSµÄrootĿ¼£¬Ò²¾ÍÊÇÖ¸¶¨µÄmount-table¡£
¹ÒÔرíµÄ¹ÒÔصãÔÚ±ê×¼HadoopÅäÖÃÎļþÖÐÖ¸¶¨¡£ViewFSµÄËùÓÐmount-tableÅäÖÃÌõÄ¿¾ùÒÔ¡°fs.viewfs.mounttable¡±ÎªÇ°×º£¬Ê¹Óá°link¡°±ê¼ÇÖ¸¶¨Á´½ÓÆäËûÎļþϵͳµÄmountµã¡£½¨ÒéʹÓÃÓë¡°link¡±ÎļþϵͳĿ±êλÖÃÏàͬµÄmountµãÃû³Æ¡£¶ÔÓÚδÔÚ°²×°±íÖÐÅäÖõÄËùÓÐÃû³Æ¿Õ¼ä£¬ÎÒÃÇ¿ÉÒÔͨ¹ýlinkFallback½«ËüÃÇ»ØÍ˵½Ä¬ÈÏÎļþϵͳ¡£
ÔÚ¼¯ÈºµÄÅäÖÃÖÐÔö¼ÓViewFSµÄmount-tableÅäÖã¬Ê¾ÀýÈçÏ£º
Hadoopϵͳ½«ÔÚHadoopÅäÖÃÎļþÖвéÕÒÃû³ÆΪ ¡°ClusterX¡±
µÄmount-table¡£½«ËùÓÐgatewayºÍserverÅäÖðüº¬¡°ClusterX¡±£¬ÈçÉÏʾÀý¡£
04ViewFSµÄÓ¦Óó¡¾°
ViewFS¿ÉÒÔÔÚÈçϳ¡¾°ÖÐʹÓãº
·Ç½á¹¹»¯µÄÔʼÊý¾Ý¿ÉÒÔͨ¹ýDistCpµÈ¹¤¾ßÖ±½Ó´æ´¢ÔÚXEOSÉÏ£¬ÒµÎñÊý¾Ý¿â½á¹¹»¯Êý¾ÝºÍÓ¦ÓÃÂòµãÊý¾Ý¿ÉÒÔͨ¹ýETLÒÔHiveµÄÍⲿ±í·½Ê½´æ´¢µ½XEOSÖС£HBaseºÍHive¼ÌÐøÔÚÔÓеÄHDFSÉÏÃæÔËÐУ¬Ò²¾ÍÊÇHBase±íÊý¾ÝºÍHiveÄÚ²¿±íÊý¾ÝÈÔȻͨ¹ýHDFSÀ´´æ´¢¡£
ÕâÑùµÄºÃ´¦ÊǺ£Á¿·Ç½á¹¹»¯Êý¾Ý£¬ÉõÖÁÊǺ£Á¿Ð¡Îļþ¶¼¿ÉÒÔÓÃXEOSÀ´³ÐÔØ£¬¼õÇáHBaseµÄѹÁ¦£¬Í¬Ê±HiveÐÂÔöÊý¾ÝÈ«²¿Í¨¹ýXEOSÀ´´æ´¢£¬ºóÐøÀ©ÈÝÈÝÁ¿½öÀ©Õ¹XEOS´æ´¢¼¯Èº¼´¿É¡£
05XEOSÅäÖÃViewFS
´óÊý¾Ýƽ̨»ùÓÚCDH 6.3.2¡£HDFS core-site.xml Ôö¼ÓÈçÏÂÅäÖãº
Hadoop FSÃüÁîÐУº
Ö´ÐÐwordcount²âÊÔ½á¹ûÈçÏ£º
06С½á
XSKYͨ¹ýViewFSµÄ·½Ê½£¬ÔÚ²»¸Ä±äÓû§Ê¹ÓÃÏ°¹ßµÄÇ°ÌáÏ£¬½«ÔÓÐHDFSÊý¾ÝÓëÐÂÔöXEOSÊý¾Ý´òͨ£¬½â¾öÁËÔÓÐHDFS¼¯ÈºÓëÐÂXEOS¼¯ÈºµÄ¹²´æÎÊÌâ¡£ÔÓеÄHDFSÊý¾Ý¿ÉÒÔ¼ÌÐøʹÓ㬶øXEOS¿ÉÒÔÓÃÓÚ³ÐÔØÐÂÉú³ÉµÄÊý¾Ý¡£
ÕâÖÖ·½Ê½²»½ö¿ÉÒÔ³ä·ÖÀûÓþÉÓÐÉ豸£¬´ïµ½½ÚÔ¼³É±¾µÄÄ¿µÄ¡£Í¬Ê±£¬Äܹ»½èÖúXEOSºáÏòÀ©Õ¹ÄÜÁ¦£¬ÊµÏÖ´æ´¢µ¥¶ÀÀ©ÈÝ¡£
ÃâÔðÉùÃ÷£º±¾ÎÄϵ»¥ÁªÍøתÔØ£¬±¾Õ¾²»±£Ö¤ÆäÄÚÈÝÕæʵÐÔÒ²²»Í¬ÒâÎÄÖй۵㣬Çë¶ÁÕß×ÔÐмø±ð£¬²¢ºËʵ¹ã¸æºÍÄÚÈÝÕæʵÐÔ£¬½÷É÷ʹÓ㬱¾Õ¾ºÍ±¾È˲»³Ðµ£Óɴ˲úÉúµÄÒ»Çз¨Âɺó¹û£¡»¥ÁªÍø½ðÈÚ·çÏÕ¾Þ´ó£¬Í¶×ÊÒª½÷É÷£¬ÈçÓÐÒìÒéÇëÁªÏµ021-54249915
ÌرðÌáÐÑ£ºÈç¹û¶ÔÀí²ÆÌرð¸ÐÐËȤµÄ£¬¿ÉÒÔ¼ÓÈë±¾Õ¾ÐܲƸ»ÏîÄ¿£¬È«²¿ÊµÅÌ£¬ÔÂÊÕÒæÎȶ¨ÔÚ20%¡ª30%£¨¸´Àû£©¡£
2020Äê07ÔÂ09ÈÕ ÓÚÉϺ£
°æȨ×÷Æ· δ¾Ðí¿É ÇëÎðתÔØ¡¡
|