#cat datahadoop fs -cat /usr/hive/warehouse/hivewithhdfs.db/record/data.txt#Modify the directory or file permissionhadoop fs -chmod -R 777 /usr#Change the file or directory ownerhadoop fs -chown -R root:root /usr#Create a folderhadoop fs -mkdir <paths>#Send a local file to HDFShadoop fs -put <localsrc> ... <dst>#Copy a local file to HDFShadoop fs -copyFromLocal <localsrc> URI#View the storage usage of a file or directoryhadoop fs -du URI [URI …]#Delete a filehadoop fs -rm URI [URI …]#Set the number of copies of a directory or filehadoop fs–setrep [-R] [-w] REP PATH [PATH …]#Check for bad blocks of a cluster filehadoop fsck <path> [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]
#nn1 is the ID of the namenode; usually nn1 and nn2.hdfs haadmin -getServiceState nn1#View the current cluster reporthdfs dfsadmin -report#namenode exits safe modehdfs dfsadmin -safemode leave
Feedback