./bin/hdfs zkfc -formatZK 初始安裝時初始化zk,在Zookeeper中創建了路徑/hadoop-ha/hacluster
./bin/hdfs haadmin -getServiceState master1 查看主節點的狀態,是active還是standby
./bin/hdfs haadmin -failover master1 master2 將master1切換爲主節點
./bin/hdfs haadmin -transitionToActive master1 將master1切換爲主節點
./hdfs dfsadmin -report 查看集羣各節點的狀態
./bin/hdfs dfsadmin -safemode get/enter/leave 查看/進入/離開 安全模式的狀態
./bin/hdfs namenode -initializeSharedEdits 將所有journal node的元文件的VERSION文件的參數修改成與namenode的元數據相同
./bin/hdfs namenode -bootstrapStandby 將active namenode的 {dfs.namenode.name.dir} 目錄的內容複製到 standby namenode的{dfs.namenode.name.dir} 目錄下
./bin/hadoop fs cat/chmod/chown/put/get/.... 對 hdfs 文件進行 輸入、查看、上傳、下載、賦權等操作,具體可以參考官網:http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html
./bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /input /output 運行 wordcount
./bin/hbase hbck 修復命令
./bin/hbase shell 進入shell
status 查看集羣狀態
create 'test', 'cf' 創建一個名爲 test 的表,含有一個列族 cf
put 'test', 'row1', 'cf:a', 'value1' 在 test 表的 row1' 行中的 cf:a 列對應的數據單元中插入字節數組 value1
scan 'test' 讀取 test 表的所有內容
get 'test', 'row1' 讀取 test 表 row1 行中的值
disable 'test' 禁用表 test
drop 'test' 刪除表 test
./bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'tablename' 利用mapreduce計數
count 'testlable1' 統計表中行的數量
snapshot 'testlable1','testlable1_snapshot' 創建快照
list_snapshots 查看快照
clone_snapshot 'testlable1_snapshot','testcp1' 從快照中克隆新表
delete_snapshot 'testlable1_snapshot' 刪除快照