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仍然報上面的異常,可先釋放部分磁盤空間,再進行嘗試。
新聞熱點
疑難解答