<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Hbase on ZRJ | 学习笔记</title>
        <link>https://blog.zrj.me/tags/hbase/</link>
        <description>Recent content in Hbase on ZRJ | 学习笔记</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>zh-CN</language>
        <lastBuildDate>Fri, 25 Mar 2016 22:08:12 +0800</lastBuildDate><atom:link href="https://blog.zrj.me/tags/hbase/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Hadoop HBase 碎碎念</title>
        <link>https://blog.zrj.me/posts/2016-03-25-hadoop-hbase-%E7%A2%8E%E7%A2%8E%E5%BF%B5/</link>
        <pubDate>Fri, 25 Mar 2016 22:08:12 +0800</pubDate>
        
        <guid>https://blog.zrj.me/posts/2016-03-25-hadoop-hbase-%E7%A2%8E%E7%A2%8E%E5%BF%B5/</guid>
        <description>&lt;p&gt;一些小笔记会持续追加到这里&lt;/p&gt;
&lt;p&gt;2016-3-25 22:09:24&lt;/p&gt;
&lt;p&gt;重启或添加节点： $bin/hadoop-daemon.sh start datanode&lt;/p&gt;
&lt;p&gt;-&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;-&lt;/p&gt;
&lt;p&gt;2016-3-25 22:09:31&lt;/p&gt;
&lt;p&gt;Had the same problem with 2.6.0, and shamouda&amp;rsquo;s answer solved it (I was not using dfs.hosts at all so that could not be the answer. I did add&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;property&amp;gt;
  &amp;lt;name&amp;gt;dfs.namenode.datanode.registration.ip-hostname-check&amp;lt;/name&amp;gt;
  &amp;lt;value&amp;gt;false&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to hdfs-site.xml and that was enough to fix the issue.&lt;/p&gt;
&lt;p&gt;-&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;-&lt;/p&gt;
&lt;p&gt;2016-3-25 22:11:55&lt;/p&gt;
&lt;p&gt;$bin/hbase-daemon.sh stop regionserver $bin/hbase-daemon.sh start regionserver&lt;/p&gt;
&lt;p&gt;-&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;ndash;&lt;/p&gt;
&lt;p&gt;2016-3-27 16:54:22&lt;/p&gt;
&lt;p&gt;disable &amp;lsquo;kline_minute&amp;rsquo; describe &amp;lsquo;kline_minute&amp;rsquo; alter &amp;lsquo;kline_minute&amp;rsquo; , NAME=&amp;gt;&amp;lsquo;kline&amp;rsquo;, COMPRESSION=&amp;gt;&amp;lsquo;gz&amp;rsquo; describe &amp;lsquo;kline_minute&amp;rsquo; enable &amp;lsquo;kline_minute&amp;rsquo; major_compact &amp;lsquo;kline_minute&amp;rsquo;&lt;/p&gt;
&lt;p&gt;启用压缩&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;http://www.searchtb.com/2011/01/understanding-hbase.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;http://www.searchtb.com/2011/01/understanding-hbase.html&lt;/a&gt;，这里说明了文件的存储方式 &lt;a class=&#34;link&#34; href=&#34;http://stackoverflow.com/questions/18656483/data-size-increases-in-hbase&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;http://stackoverflow.com/questions/18656483/data-size-increases-in-hbase&lt;/a&gt;，这里有一个计算的例子&lt;/p&gt;
&lt;p&gt;-&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;ndash;&lt;/p&gt;
&lt;p&gt;2016-3-27 16:56:14&lt;/p&gt;
&lt;p&gt;重启一个regionserver&lt;/p&gt;
&lt;p&gt;bin/graceful_stop.sh &amp;ndash;restart &amp;ndash;reload &amp;ndash;debugnodename&lt;/p&gt;
&lt;p&gt;这个操作是平滑的重启regionserver进程，对服务不会有影响，他会先将需要重启的regionserver上面的所有region迁移到其它的服务器，然后重启，最后又会将之前的region迁移回来，但我们修改一个配置时，可以用这种方式重启每一台机子，这个命令会关闭balancer，所以最后我们要在hbase shell里面执行一下balance_switch true，对于hbase regionserver重启，不要直接kill进程，这样会造成在zookeeper.session.timeout这个时间长的中断，也不要通过bin/hbase-daemon.sh stop regionserver去重启，如果运气不太好，-ROOT-或者.META.表在上面的话，所有的请求会全部失败。&lt;/p&gt;
&lt;p&gt;关闭下线一台regionserver&lt;/p&gt;
&lt;p&gt;bin/graceful_stop.sh &amp;ndash;stop nodename&lt;/p&gt;
&lt;p&gt;和上面一样，系统会在关闭之前迁移所有region，然后stop进程，同样最后我们要手工balance_switch true，开启master的region均衡。&lt;/p&gt;
</description>
        </item>
        <item>
        <title>hbase 创建表时提示存在删除时时又提示不存在</title>
        <link>https://blog.zrj.me/posts/2016-03-21-hbase-%E5%88%9B%E5%BB%BA%E8%A1%A8%E6%97%B6%E6%8F%90%E7%A4%BA%E5%AD%98%E5%9C%A8%E5%88%A0%E9%99%A4%E6%97%B6%E6%97%B6%E5%8F%88%E6%8F%90%E7%A4%BA%E4%B8%8D%E5%AD%98%E5%9C%A8/</link>
        <pubDate>Mon, 21 Mar 2016 12:20:02 +0800</pubDate>
        
        <guid>https://blog.zrj.me/posts/2016-03-21-hbase-%E5%88%9B%E5%BB%BA%E8%A1%A8%E6%97%B6%E6%8F%90%E7%A4%BA%E5%AD%98%E5%9C%A8%E5%88%A0%E9%99%A4%E6%97%B6%E6%97%B6%E5%8F%88%E6%8F%90%E7%A4%BA%E4%B8%8D%E5%AD%98%E5%9C%A8/</guid>
        <description>&lt;p&gt;看到这里，&lt;a class=&#34;link&#34; href=&#34;http://arnon.me/2013/01/killing-hbase-zombie-table/&#34;  title=&#34;http://arnon.me/2013/01/killing-hbase-zombie-table/&#34;
     target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;http://arnon.me/2013/01/killing-hbase-zombie-table/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of our team leaders approached me in the hall today and asked if I could land a hand in troubleshooting something. He and our QA lead were configuring one of our test Hadoop clusters after an upgrade and they had a problem with one table they were trying to set up:&lt;/p&gt;
&lt;p&gt;When they tried to create the table in HBase shell they got an error that the table exists When they tried to delete the table they got an error that the table does not exist HBase ships with a health-check and fix util called hbck (use: hbase hbck to run. see here for details) – they’ve run hbase reports everything is fine and dandy Hmm, The first thing I tied to do is to look at the .META. table. This is where HBase keeps the tables and the regions they use. I thought maybe there was some just there. but it didn’t look like that. I tried to do a major compaction for it and that didn’t help either.&lt;/p&gt;
&lt;p&gt;The next thing I tried actually found the problem. I ran the Zookeeper client (I used hbase zkcli but you can also run it via zookeeper scripts) and looked at /hbase/table (ls /hbase table) -the zombie table was listed right there with all the legit tables. HBase stores some data schema and state of each table in zookeeper to be able to coordinate between all the regionservers and it seems that during the upgrade process the system was restarted a few times. One of these restarts coincided with a removal of the table and caught it in the middle.&lt;/p&gt;
&lt;p&gt;Ok, so that is the problem – what’s the solution? Simple just remove the offending znode from zookeeper (rmr /hbase/table/TABLE_NAME ) and restart the cluster (since the data is cached in the regionservers/hbase master to save trips to zookeeper). Also be careful not to remove any other node or you’d cause problems to other tables.&lt;/p&gt;
&lt;p&gt;The role of ZooKeeper in HBase is not documented very well. The only online account of ZooKeeper’s role with HBase I found (save looking at the code itself of course) is really outdated. Hopefully this post will save some head scratching and time for others who find themselves with the same problem.&lt;/p&gt;
&lt;p&gt;Anyway, I hope the next post I’ll do on ZooKeeper will be about something much nicer :)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;嗯，hbase 自带了一个 zkcli，所以操作起来还是比较简单的&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
