hbase由于未设置TTL,导致磁盘空间占满,需要删除数据,或设置TTL。 查看磁盘空间占用情况:
$ df -m查看磁盘空间占用情况:
$ du -sh *最终发现是hadoop文件夹占用最高,确切说是./hadoop/tmp/dfs/data文件夹占空间最大。 根据我们自己的业务情况,容易判断出是hbase不断写入导致的问题,通过查看hdfs得到验证:
$ ./hadoop fs -du -h /12.9 G /hbase78.3 K /tmp设置hbase表的TTL, 30天
$ ./hbase shellhbase> desc 'ns1:t1'hbase> disable 'ns1:t1'hbase> alter 'ns1:t1', {NAME => 'n1', TTL => '2592000'}, {NAME => 'n2', TTL => '2592000'}hbase> enable 'ns1:t1'设置成功后,hbase自动将过期数据删除,进行合并region操作。磁盘空间得以释放。
与网上查到的问题不太一样,我碰到的问题现状是hbase shell可以正常启动,执行list命令OK,但是执行desc命令时就报错Connection refused 查看hbase日志,发现hbase-xxx-regionserver-xxx.log日志中,显示regionserver有异常。
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File xxx could only be replicated to 0 nodes instead of minReplication (=1). There are 1 datanode(s) running and no node(s) are excluded in this Operation.这个异常没有仔细定位,感觉同样是因为资源占满问题导致的。查看hbase的进程,果然只有master,没有regionserver。
$ ps -aux | grep hbase重新启动hbase,会提示master进程已存在,并继续启动regionserver进程。
$ start-hbase.shregionserver进程启动成功后,该问题解决,可以正常操作hbase。如果regionserver仍然报上面的异常,可先释放部分磁盘空间,再进行尝试。
新闻热点
疑难解答