Let us explore details about how to list the commands and get the help or usage for given command.
- Even though we can run commands from almost all the nodes in the clusters, we should only use Gateway to run HDFS Commands.
- First we need to make sure designated Gateway server is Gateway for HDFS service so that we can run commands from Gateway node. In our case we have designated bigdataserver-1 as Gateway.
- Let us make sure that bigdataserver-1 is added as HDFS Gateway so that we can run our commands successfully.
- Also we can run commands by connecting to multiple clusters. However, we cannot configure one server as Gateway for multiple clusters and hence we have to specify the URI for Namenode using -fs. We can get Namenode URI from core-site.xml or Cloudera Manager.
- Typically Namenode process will be running on port number 8020.
hadoop fs
– list all the commands availablehadoop fs -usage
– will give us basic usage for given commandhadoop fs -help
– will give us additional information for all the commands- We can run help on individual commands as well.
- Let us also review very important command
hadoop fs -ls
to list files and directories under given path