{"id":210,"date":"2018-06-19T16:53:11","date_gmt":"2018-06-19T08:53:11","guid":{"rendered":"http:\/\/www.heoffice.com\/?p=210"},"modified":"2018-06-19T17:30:26","modified_gmt":"2018-06-19T09:30:26","slug":"docker-hbase%e5%88%9d%e4%bd%93%e9%aa%8c","status":"publish","type":"post","link":"https:\/\/heoffice.com\/?p=210","title":{"rendered":"Docker Hbase\u521d\u4f53\u9a8c"},"content":{"rendered":"<h3>\u5b89\u88c5<\/h3>\n<p>https:\/\/github.com\/harisekhon\/dockerfiles \u4e2d\u5305\u542bN\u591aHadoop\u7684docker\u9879\u76ee,\u7528\u4e8e\u4f53\u9a8cHadoop\u662f\u633a\u597d\u7684\u9009\u62e9, \u4ee5\u4e0b\u662f\u600e\u4e48\u5728Docker\u4e0b\u4f53\u9a8cHbase\u9879\u76ee<\/p>\n<p>\u4e0b\u8f7d Dockerfiles<\/p>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">git clone git@github.com:HariSekhon\/Dockerfiles.git\nmv Dockerfiles hadoop-docker\ncd hadoop-docker\n<\/code><\/pre>\n<p>\u8fd0\u884cHbase<\/p>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">cd hbase-dev\ndocker-compose up -d\n<\/code><\/pre>\n<p>\u5728\u6d4f\u89c8\u5668\u6253\u5f00<br \/>\n&#8211; http:\/\/localhost:16010\/<br \/>\n\u5982\u679c\u770b\u5230\u4e0b\u56fe, \u8868\u540d\u5b89\u88c5\u6210\u529f.<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.heoffice.com\/wp-content\/uploads\/2018\/06\/hbase-1-300x159.png\" alt=\"\" \/><\/p>\n<h3>\u4f53\u9a8c<\/h3>\n<ul>\n<li>\u8fdb\u5165hbase\u5bb9\u5668<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-sh\">cd hbase-dev\ndocker-compose exec hbase-dev bash\nhbase shell\n<\/code><\/pre>\n<ul>\n<li>list \u5217\u51fa\u5f53\u524dtables<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-sh\">hbase(main):001:0&gt; list\nTABLE\n0 row(s) in 0.3360 seconds\n\n=&gt; []\n<\/code><\/pre>\n<ul>\n<li>\u521b\u5efaemp\u8868<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">hbase(main):001:0&gt; create 'emp', 'personal data', 'professional data'\n0 row(s) in 1.6220 seconds\n\n=&gt; Hbase::Table - emp\n<\/code><\/pre>\n<ul>\n<li>\u63d2\u5165\u6570\u636e<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">hbase(main):003:0&gt; put 'emp','1','personal data:name','raju'\n0 row(s) in 0.1370 seconds\n\nhbase(main):005:0&gt; scan 'emp'\nROW                                                  COLUMN+CELL\n 1                                                   column=personal data:name, timestamp=1529399837299, value=raju\n1 row(s) in 0.0410 seconds\n<\/code><\/pre>\n<ul>\n<li>\u66f4\u65b0\u6570\u636e<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">hbase(main):012:0&gt; put 'emp','1','personal data:name','raju-1'\n0 row(s) in 0.0100 seconds\n\nhbase(main):013:0&gt; scan 'emp'\nROW                                                  COLUMN+CELL\n 1                                                   column=personal data:name, timestamp=1529400258739, value=raju-1\n1 row(s) in 0.0390 seconds\n<\/code><\/pre>\n<ul>\n<li>\u8bfb\u53d6\u6570\u636e<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">hbase(main):014:0&gt; get 'emp', '1'\nCOLUMN                                               CELL\n personal data:name                                  timestamp=1529400258739, value=raju-1\n1 row(s) in 0.0440 seconds\n<\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u5355\u5143\u683c<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">delete 'emp', '1', 'personal data:name'\n<\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u8868\u7684\u6240\u6709\u5355\u5143\u683c<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-bash\">deleteall 'emp','1'\n<\/code><\/pre>\n<ul>\n<li>\u8ba1\u6570<\/li>\n<\/ul>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-sh\">hbase(main):022:0&gt; count 'emp'\n0 row(s) in 0.0460 seconds\n\n=&gt; 0\n<\/code><\/pre>\n<h3>\u53c2\u8003<\/h3>\n<ul>\n<li>https:\/\/www.yiibai.com\/hbase\/hbase_shell.html<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5 https:\/\/github.com\/harisekhon\/dockerfiles \u4e2d\u5305\u542bN\u591aHadoo&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[35,36],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-hadoop","category-hbase"],"acf":[],"_links":{"self":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":6,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/heoffice.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions\/217"}],"wp:attachment":[{"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heoffice.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}