hbase balance命令相关
balance主要有四個命令
balance_switch??balancer??balancer_enabled??balance_rsgroup(如果開啟了rsgroup)
1.?balance_switch??
hbase幫助信息:
hbase(main):001:0>?help 'balance_switch'
Enable/Disable balancer. Returns previous balancer state.
Examples:
? hbase> balance_switch true
? hbase> balance_switch false
開啟或關閉自動 balance, 返回的是之前的狀態, 切記, 切記, 返回的是之前的狀態, 我就是想當然的以為是當前狀態, 結果鬧了好多笑話.
這里面還需要注意的一點就是, 幫助信息里面只有 true 和 false, 而自己敲命令的時候, 寫完 balance_switch 再隨便跟個字母, tab鍵提示的時候會有一堆命令, 我就用了其中一個命令?balance_switch?status, 還以為是查看balance當前狀態的, 結果就搞笑了,? 一會兒true, 一會兒false
balance_switch?status 經測試, 這個命令的意思是將balance狀態強制轉換為false, 無論之前是true還是false,?返回的是之前的狀態, 所以一會兒true, 一會兒false, 所以這個命令很雞肋, 別亂用, 查看當前狀態的命令是balancer_enabled, 后面說
2.?balancer??
hbase幫助信息:
hbase(main):027:0* help 'balancer'
Trigger the cluster balancer. Returns true if balancer ran and was able to
tell the region servers to unassign all the regions to balance ?(the re-assignment itself is async).?
Otherwise false (Will not run if regions in transition).
這個命令是手動執行一次整個集群的balance, 如果執行成功了就會返回true, 如果因為某些原因沒執行成功, 返回false
3.?balancer_enabled??
hbase(main):032:0* help 'balancer_enabled'
Query the balancer's state.
Examples:
? hbase> balancer_enabled
查看當前balancer的狀態, 這個命令才是真正查詢balancer狀態的.
4.?balance_rsgroup(如果)
這個命令只有開啟了rsgroup才會有
hbase幫助信息:
hbase(main):033:0> help 'balance_rsgroup'
Balance a RegionServer group
Example:
? hbase> balance_rsgroup 'my_group'
應該是手動balance一次分組
總結
對于自動balance來說, 只需要關注三個命令:
balance_switch true? ?開啟自動balance
balance_switch false? 關閉自動balance
balancer_enabled? ? ? 查看自動balance當前狀態
總結
以上是生活随笔為你收集整理的hbase balance命令相关的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 用户空间优化中断 irqba
- 下一篇: SpringCloud集成LoadBal