{"id":109253,"date":"2021-02-19T11:00:54","date_gmt":"2021-02-19T05:30:54","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?page_id=109253"},"modified":"2024-04-12T14:30:29","modified_gmt":"2024-04-12T09:00:29","slug":"hbase-commands","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/","title":{"rendered":"HBase Commands"},"content":{"rendered":"\n<p>Use the help command to get a list of commands categorized by type. The command groups can be categorized as<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>General: These commands discover general information at the cluster level. Examples include status, whoami, and version.<\/li><li>DDL: These commands create, alter, and drop HBase tables. Examples include alter, create, describe, drop, enable, disable, and list.<\/li><li>DML: These commands add, modify, and delete data from HBase tables. Examples include get, put, delete, deleteall, get_counter, incr, put, scan, and truncate.<\/li><li>Tools: These commands perform maintenance of the HBase cluster. Examples include assign, close_region, compact, flush, hlog_roll, and major_compact.<\/li><li>Replication : These commands support adding and removing nodes in the cluster. Examples include add_peer, enable_peer, disable_peer, list_peers, start_replication, and&nbsp;&nbsp; stop_replication.<\/li><li>Snapshot : These commands support taking snapshots of the HBase cluster for backup and recovery. Examples include snapshot, restore_snapshot, and list_snapshots.<\/li><li>Security: These commands assign security in HBase. Examples include grant and revoke.<\/li><\/ul>\n\n\n\n<p>HBase commands for data management are<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a table &#8211; Use the create command to create a new table. You must specify the table name and the ColumnFamily name.<\/li><\/ul>\n\n\n\n<p>hbase(main):001:0&gt; create &#8216;test&#8217;, &#8216;cf&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.4170 seconds<\/p>\n\n\n\n<p>=&gt; Hbase::Table &#8211; test<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>List Information About your Table &#8211; Use the list command to<\/li><\/ul>\n\n\n\n<p>hbase(main):002:0&gt; list &#8216;test&#8217;<\/p>\n\n\n\n<p>TABLE<\/p>\n\n\n\n<p>test<\/p>\n\n\n\n<p>1 row(s) in 0.0180 seconds<\/p>\n\n\n\n<p>=&gt; [&#8220;test&#8221;]\n\n\n\n<ul class=\"wp-block-list\"><li>Put data into your table &#8211; To put data into your table, use the put command.<\/li><\/ul>\n\n\n\n<p>hbase(main):003:0&gt; put &#8216;test&#8217;, &#8216;row1&#8217;, &#8216;cf:a&#8217;, &#8216;value1&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.0850 seconds<\/p>\n\n\n\n<p>hbase(main):004:0&gt; put &#8216;test&#8217;, &#8216;row2&#8217;, &#8216;cf:b&#8217;, &#8216;value2&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.0110 seconds<\/p>\n\n\n\n<p>hbase(main):005:0&gt; put &#8216;test&#8217;, &#8216;row3&#8217;, &#8216;cf:c&#8217;, &#8216;value3&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.0100 seconds<\/p>\n\n\n\n<p>Here, we insert three values, one at a time. The first insert is at row1, column cf:a, with a value of value1. Columns in HBase are comprised of a column family prefix, cf in this example, followed by a colon and then a column qualifier suffix, a in this case.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Scan the table for all data at once &#8211; One of the ways to get data from HBase is to scan. Use the scan command to scan the table for data. You can limit your scan, but for now, all data is fetched.<\/li><\/ul>\n\n\n\n<p>hbase(main):006:0&gt; scan &#8216;test&#8217;<\/p>\n\n\n\n<p>ROW COLUMN+CELL<\/p>\n\n\n\n<p>row1column=cf:a, timestamp=1421762485768, value=value1<\/p>\n\n\n\n<p>row2column=cf:b, timestamp=1421762491785, value=value2<\/p>\n\n\n\n<p>row3column=cf:c, timestamp=1421762496210, value=value3<\/p>\n\n\n\n<p>3 row(s) in 0.0230 seconds<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Get a single row of data &#8211; To get a single row of data at a time, use the get command.<\/li><\/ul>\n\n\n\n<p>hbase(main):007:0&gt; get &#8216;test&#8217;, &#8216;row1&#8217;<\/p>\n\n\n\n<p>COLUMN&nbsp;&nbsp; CELL<\/p>\n\n\n\n<p>cf:atimestamp=1421762485768, value=value1<\/p>\n\n\n\n<p>1 row(s) in 0.0350 seconds<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Disable a table &#8211; If you want to delete a table or change its settings, as well as in some other situations, you need to disable the table first, using the disable command. You can re-enable it using the enable command.<\/li><\/ul>\n\n\n\n<p>hbase(main):008:0&gt; disable &#8216;test&#8217;<\/p>\n\n\n\n<p>0 row(s) in 1.1820 seconds<\/p>\n\n\n\n<p>hbase(main):009:0&gt; enable &#8216;test&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.1770 seconds<\/p>\n\n\n\n<p>Disable the table again if you tested the enable command above:<\/p>\n\n\n\n<p>hbase(main):010:0&gt; disable &#8216;test&#8217;<\/p>\n\n\n\n<p>0 row(s) in 1.1820 seconds<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Drop the table &#8211; To drop (delete) a table, use the drop command.<\/li><\/ul>\n\n\n\n<p>hbase(main):011:0&gt; drop &#8216;test&#8217;<\/p>\n\n\n\n<p>0 row(s) in 0.1370 seconds<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Exit the HBase Shell &#8211; To exit the HBase Shell and disconnect from your cluster, use the quit command. HBase is still running in the background.<\/li><li>Stop HBase &#8211; In the same way that the bin\/start-hbase.sh script is provided to conveniently start all HBase daemons, the bin\/stop-hbase.sh script stops them.<\/li><\/ul>\n\n\n\n<p>$ .\/bin\/stop-hbase.sh<\/p>\n\n\n\n<p>stopping hbase&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p>$<\/p>\n\n\n\n<p>After issuing the command, it can take several minutes for the processes to shut down. Use the jps to be sure that the HMaster and HRegionServer processes are shut down.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use the help command to get a list of commands categorized by type. The command groups can be categorized as General: These commands discover general information at the cluster level. Examples include status, whoami, and version. DDL: These commands create, alter, and drop HBase tables. Examples include alter, create, describe, drop, enable, disable, and list&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-109253","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HBase Commands - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HBase Commands - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Use the help command to get a list of commands categorized by type. The command groups can be categorized as General: These commands discover general information at the cluster level. Examples include status, whoami, and version. DDL: These commands create, alter, and drop HBase tables. Examples include alter, create, describe, drop, enable, disable, and list....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T09:00:29+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/\",\"name\":\"HBase Commands - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2021-02-19T05:30:54+00:00\",\"dateModified\":\"2024-04-12T09:00:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HBase Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HBase Commands - Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/","og_locale":"en_US","og_type":"article","og_title":"HBase Commands - Tutorial","og_description":"Use the help command to get a list of commands categorized by type. The command groups can be categorized as General: These commands discover general information at the cluster level. Examples include status, whoami, and version. DDL: These commands create, alter, and drop HBase tables. Examples include alter, create, describe, drop, enable, disable, and list....","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T09:00:29+00:00","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/","name":"HBase Commands - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2021-02-19T05:30:54+00:00","dateModified":"2024-04-12T09:00:29+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hbase-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"HBase Commands"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=109253"}],"version-history":[{"count":1,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109253\/revisions"}],"predecessor-version":[{"id":109254,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109253\/revisions\/109254"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=109253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=109253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=109253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}