{"id":195040,"date":"2013-09-26T20:44:03","date_gmt":"2013-09-26T16:44:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=195040"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=195040","title":{"rendered":"<span class=\"post_title\">HBase, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 bulk load<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u0433\u0438.<br \/>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HBase, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e <b>bulk loading<\/b>. \u042d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 (\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430). \u0415\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e bulk load \u043c\u043e\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418 \u0442\u0430\u043a, \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 bulk load \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u0440\u0438 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ul>\n<li>\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 HDFS<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c MapReduce \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 HFile, \u043f\u043e\u0441\u0443\u0442\u0438 HBase \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c bulk load \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043b\u044c\u0451\u0442 (\u043f\u0440\u0438\u0432\u044f\u0436\u0435\u0442) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 HBase.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/27d\/061\/76f\/27d06176f3728eb4f598f235fd56a71b.png\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u0435\u0451 \u0432 \u0446\u0438\u0444\u0440\u0430\u0445: \u0447\u0435\u043c\u0443 \u0440\u0430\u0432\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u042d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438 bulk load.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/h4>\n<p>  \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Cloudera CDH4, HBase 0.94.6-cdh4.3.0. <br \/>  \u0422\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u0430 (\u043d\u0430 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0435), \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CentOS \/ 4CPU \/ RAM 8GB \/ HDD 50GB<br \/>  \u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0432 CSV \u0444\u0430\u0439\u043b\u0430\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u043c \u043e\u0431\u044a\u0451\u043c\u043e\u043c 2GB, 3.5GB, 7.1GB \u0438 14.2GB<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445:<\/p>\n<p>  Bulk loading<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/236\/f21\/892\/236f21892b251a064b2780513b4e4a6c.png\"\/><\/p>\n<p>  C\u043a\u043e\u0440\u043e\u0441\u0442\u044c:  <\/p>\n<ul>\n<li>Max 29.2 Mb\/sec \u0438\u043b\u0438 58K rec\/sec (3.5GB \u0432 28 \u0444\u0430\u0439\u043b\u0430\u0445)<\/li>\n<li>Average 27 Mb\/sec \u0438\u043b\u0438 54K rec\/sec(\u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u0430\u044f \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 )<\/li>\n<li>Min 14.5 Mb\/sec \u0438\u043b\u0438 29K rec\/sec (2GB \u0432 100 \u0444\u0430\u0439\u043b\u0430\u0445)<\/li>\n<li>1 \u0444\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 20% \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c 100<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 (row): 0.5\u041ab<br \/>  \u0412\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 MapReduce Job: 70 sec<br \/>  \u0412\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 HDFS \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:  <\/p>\n<ul>\n<li>3.5GB \/ 1 \u0444\u0430\u0439\u043b \u2014 65 sec <\/li>\n<li>7.5GB \/ 100 \u2014 150 sec <\/li>\n<li>14.2G \/ 1 \u0444\u0430\u0439\u043b \u2014 285 sec<\/li>\n<\/ul>\n<h4>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u044b:<\/h4>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u0441 2-\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 \u043f\u043e 8 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c.<br \/>  \u041a\u043b\u0438\u0435\u043d\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u043a\u0440\u043e\u043d\u0443 \u0432 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 CPU \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u043b\u0430 40%<br \/>  \u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 (row), \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b \u0440\u0430\u0432\u0435\u043d 0.5\u041ab.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/e30\/600\/e5e\/e30600e5e644f79bce62aa74bbbdf090.png\"\/><\/p>\n<h4>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435?<\/h4>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/8ac\/ae2\/379\/8acae237916cf564612d6f81f58e359f.png\"\/><\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430 \u0432\u043e\u043b\u043d\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u043e bulk load \u043a\u0430\u043a \u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0442\u044c \u0438 CPU. \u041a\u0430\u043a \u0431\u044b \u0442\u0430\u043c \u043d\u0438 \u0431\u044b\u043b\u043e, \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. \u0422\u0435\u0441\u0442\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0447\u0442\u043e bulk load \u0431\u044b\u0441\u0442\u0440\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432 \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0440\u0430\u0437\u0430, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 m\/r \u0434\u0436\u043e\u0431\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 HDFS, \u043d\u0430 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435 \u0442\u043e \u0432\u0440\u0435\u043c\u044f.<br \/>  \u0414\u0443\u043c\u0430\u044e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a bulk load \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u043a \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u0438\u043d\u043e\u043c\u0443 (\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u043c\u0443).<\/p>\n<h4>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>  \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u044e\u0430\u043d\u0441\u043e\u0432.<\/p>\n<pre><code class=\"java\">\/\/\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0436\u043e\u0431 Job job = new Job(configuration, JOB_NAME); job.setJarByClass(BulkLoadJob.class);  job.setMapOutputKeyClass(ImmutableBytesWritable.class); job.setMapOutputValueClass(Put.class);  job.setMapperClass(DataMapper.class); job.setNumReduceTasks(0);  job.setInputFormatClass(TextInputFormat.class); job.setOutputFormatClass(HFileOutputFormat.class);  FileInputFormat.setInputPaths(job, inputPath); HFileOutputFormat.setOutputPath(job, new Path(outputPath));  HTable dataTable = new HTable(jobConfiguration, TABLE_NAME); HFileOutputFormat.configureIncrementalLoad(job, dataTable);  \/\/\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c ControlledJob controlledJob = new ControlledJob(     job,     null );  JobControl jobController = new JobControl(JOB_NAME); jobController.addJob(controlledJob);  Thread thread = new Thread(jobController); thread.start(); . . . \/\/\u0414\u0430\u0451\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 output setFullPermissions(JOB_OUTPUT_PATH);  \/\/\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e bulk-load LoadIncrementalHFiles loader = new LoadIncrementalHFiles(jobConfiguration); loader.doBulkLoad(         new Path(JOB_OUTPUT_PATH),         dataTable ); <\/code><\/pre>\n<ul>\n<li><b>MapReduce Job<\/b> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b c \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d.<\/li>\n<li><b>bulk load<\/b> \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f hbase, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u044b, \u0438 \u0432\u0430\u043b\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c: <b>org.apache.hadoop.security.AccessControlException: Permission denied: user=hbase<\/b><\/li>\n<\/ul>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Job \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f hbase \u0438\u043b\u0438 \u0440\u0430\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (\u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u044f \u0441\u0434\u0435\u043b\u0430\u043b).<\/p>\n<ul>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 HBase. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u043c Region-\u043e\u043c. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u0443 \u043d\u043e\u0434\u0443, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f \u0435\u0451 \u043d\u0430 100% \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0443\u0440\u044f\u0442.<br \/>   \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c pre-split. \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 10 Region-\u043e\u0432 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/li>\n<\/ul>\n<pre><code class=\"java\">\/\/\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435-\u0441\u043f\u043b\u0438\u0442 HTableDescriptor descriptor = new HTableDescriptor(         Bytes.toBytes(tableName) );  descriptor.addFamily(         new HColumnDescriptor(Constants.COLUMN_FAMILY_NAME) );  HBaseAdmin admin = new HBaseAdmin(config);  byte[] startKey = new byte[16]; Arrays.fill(startKey, (byte) 0);  byte[] endKey = new byte[16]; Arrays.fill(endKey, (byte)255);  admin.createTable(descriptor, startKey, endKey, REGIONS_COUNT); admin.close(); <\/code><\/pre>\n<ul>\n<li>MapReduce Job \u043f\u0438\u0448\u0435\u0442 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0435\u043c\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0443\u0431\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 column family. \u0424\u0430\u0439\u043b\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c<\/li>\n<\/ul>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u044d\u0442\u043e \u0432\u0441\u0451. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u0443\u0431\u044b\u0439 \u0442\u0435\u0441\u0442, \u0431\u0435\u0437 \u0445\u0438\u0442\u0440\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c.<\/p>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/2anikulin\/hbase-bulk-load\">github.com\/2anikulin\/hbase-bulk-load<\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/195040\/\"> http:\/\/habrahabr.ru\/post\/195040\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u0433\u0438.<br \/>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HBase, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e <b>bulk loading<\/b>. \u042d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 (\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430). \u0415\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e bulk load \u043c\u043e\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-195040","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=195040"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195040\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}