{"id":237,"date":"2016-11-25T09:42:30","date_gmt":"2016-11-25T11:42:30","guid":{"rendered":"http:\/\/portal.venidera.com\/kb\/?p=237"},"modified":"2018-07-26T13:39:50","modified_gmt":"2018-07-26T16:39:50","slug":"english-cleaning-opentsdb-schema-on-hbase-normal-and-crash-situations","status":"publish","type":"post","link":"https:\/\/portal.venidera.com\/kb\/2016\/11\/25\/english-cleaning-opentsdb-schema-on-hbase-normal-and-crash-situations\/","title":{"rendered":"(English) Cleaning OpenTSDB schema on Hbase (normal and crash situations)"},"content":{"rendered":"<p class=\"qtranxs-available-languages-message qtranxs-available-languages-message-pb\">Desculpe-nos, mas este texto est\u00e1 apenas dispon\u00edvel em <a href=\"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/posts\/237?lang=en\" class=\"qtranxs-available-language-link qtranxs-available-language-link-en\" title=\"English\">English<\/a>. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.<\/p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 hundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-overflow:visible;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-margin-bottom:0px;\"><div class=\"fusion-column-wrapper fusion-flex-column-wrapper-legacy\">Suppose that for any reason you need to clean the <a href=\"http:\/\/opentsdb.net\/docs\/build\/html\/installation.html\">OpenTSDB<\/a>\u00a0schema. There is an easy way, you can do:<\/p>\n[code]\n$ hbase shell<br \/>\nhbase(main):001:0&gt; disable &#8216;tsdb&#8217;<br \/>\nhbase(main):002:0&gt; disable &#8216;tsdb-meta&#8217;<br \/>\nhbase(main):003:0&gt; disable &#8216;tsdb-tree&#8217;<br \/>\nhbase(main):004:0&gt; disable &#8216;tsdb-uid&#8217;<br \/>\nhbase(main):005:0&gt; drop &#8216;tsdb&#8217;<br \/>\nhbase(main):006:0&gt; drop &#8216;tsdb-meta&#8217;<br \/>\nhbase(main):007:0&gt; drop &#8216;tsdb-tree&#8217;<br \/>\nhbase(main):008:0&gt; drop &#8216;tsdb-uid&#8217;[\/code]\n<p>Ok, no problem. Just &#8216;disable&#8217; and then &#8216;drop&#8217; them.<br \/>\nThis is the common procedure in standalone Hbase, also in consistent HDFS.<br \/>\nBut, if you can&#8217;t see the tables when you do:<\/p>\n[code]\n$ hbase shell<br \/>\nhbase(main):001:0&gt; list[\/code]\n<p>And you try to create the OpenTSDB tables and it fails telling you that the tables already exists. So you can&#8217;t create the tables but also can&#8217;t disable and drop them.<br \/>\nIn this case you must use the zookeeper client, so you will need to:<\/p>\n[code]\nroot@hb-nodeX:\/# hbase zkcli<br \/>\nls \/hbase[replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, region-in-transition, online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table]\nls \/hbase\/table[tsdb, tsdb-uid, tsdb-meta, tsdb-tree, hbase:meta]\nrmr \/hbase\/table\/tsdb<br \/>\nrmr \/hbase\/table\/tsdb-uid<br \/>\nrmr \/hbase\/table\/tsdb-meta<br \/>\nrmr \/hbase\/table\/tsdb-tree<br \/>\nrmr \/hbase\/table\/hbase:meta<br \/>\nquit[\/code]\n<p>And now you can create the schema again (change the commands below according your system):<\/p>\n[code]\nroot@hb-nodeX:\/# export COMPRESSION=LZO<br \/>\nroot@hb-nodeX:\/# export HBASE_HOME=\/usr\/lib\/hbase<br \/>\nroot@hb-nodeX:\/# export JAVA_HOME=\/usr\/lib\/jvm\/java-8-oracle<br \/>\nroot@hb-nodeX:\/# \/usr\/share\/opentsdb\/tools\/create_table.sh[\/code]\n<p>And OpenTSDB will work again!!<\/p>\n<p>Reference:<br \/>\n<a href=\"http:\/\/arnon.me\/2013\/01\/killing-hbase-zombie-table\/\">Killing zombie tables<\/a><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,5],"tags":[],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-hbase","category-infra"],"_links":{"self":[{"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/comments?post=237"}],"version-history":[{"count":5,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/posts\/237\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/portal.venidera.com\/kb\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}