Hadoop highly available cluster hdfs command
Hdfs haadmin View help Command
Hdfs haadmin View help Command [hadoop@ruozedata001 ~] $hdfs haadminUsage: DFSHAAdmin [- ns] [- transitionToActive [--forceactive]] [- transitionToStandby] [- failover [--forcefence] [--forceactive]] [- getServiceState] [- checkHealth] [- help]
Hdfs haadmin-getServiceState nn1 nn2
Note: where nn1 and nn2 are server id of namenode, not machine name
Find service id in hdfs.xml, and the configuration file is as follows
Dfs.nameservices cluster dfs.ha.namenodes.cluster nn1,nn2
Hdfs failover
Hdfs fsck command to do hdfs cluster health check, when files are corrupted
Hdfs fsck / check the cluster data from the root directory
Hdfs fsck /-delete deletes corrupted data files on hdfs