In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Official document: http://hadoop.apache.org/docs/r1.2.1/file_system_shell.html
1. Log in to the primary node and switch to the hdfs user
[hdfs@cdhm1~] # su-hdfs
2. List the subdirectories and files of the current directory
[hdfs@cdhm1] $hadoop fs-ls / Found 2 itemsdrwxrwxrwt-hdfs supergroup 02017-05-23 16:39 / tmpdrwxr-xr-x-hdfs supergroup 02017-05-24 15:45 / user
3. In the Hadoop file system, create a test directory
[hdfs@cdhm1 ~] $hadoop fs-mkdir / user/hdfs/test
Check that there is a test directory under the directory, and it is created successfully.
[hdfs@cdhm1] $hadoop fs-ls / user/hdfs/Found 4 itemsdrwx--hdfs supergroup0 2017-05-26 08:00 / user/hdfs/.Trashdrwxr-xr-x-hdfs supergroup0 2017-06-05 15 15 paste 19Greater hdfsax. SparkStagingdrwx-- hdfs supergroup0 2017-05-24 15:46/user/hdfs/.stagingdrwxr-xr-x-hdfs supergroup0 2017-07-03 10:19 / user/hdfs/test
4. Delete the test directory
[hdfs@cdhm1 ~] $hadoop fs-rmr / user/hdfs/test17/07/03 10:46:06INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 1440 minutes, Emptier interval = 0 minutes.Moved:'hdfs://cdhm1:8020/user/hdfs/test' to trash at:hdfs://cdhm1:8020/user/hdfs/.Trash/Current
Check again that the test directory is gone.
[hdfs@cdhm1] $hadoop fs-ls / user/hdfs/Found 3 itemsdrwx--hdfs supergroup 0 2017-07-03 10:46 / user/hdfs/.Trashdrwxr-xr-x-hdfs supergroup 0 2017-06-05 1515 19UserUserUserCharger hdfsscar.sparkStagingdrwx-- hdfs supergroup 0 2017-05-24 15:46/user/hdfs/.staging
5. Download the files in the Hadoop file system to the local
[hdfs@cdhm1 ~] $hadoop fs-get / user/hdfs/test2
Check the local test2 download successfully
[hdfs@cdhm1 ~] $lstest2 test.txt
Upload local files to the Hadoop file system
[hdfs@cdhm1 ~] $hadoop fs-put test.txt / user/hdfs/
Check that test.txt has been uploaded successfully in hadoop
[hdfs@cdhm1] $hadoop fs-ls / user/hdfs/Found 5 itemsdrwx--hdfs supergroup 0 2017-07-03 10:46 / user/hdfs/.Trashdrwxr-xr-x-hdfs supergroup 0 2017-06-05 1515 hdfs 19user hdfs hdfs.sparkStagingdrwx-- hdfs supergroup 0 2017-05-24 15lace 46hand username hdfshand. Supergroup 0 2017-07-03 11:13 / user/hdfs/test.txtdrwxr-xr-x-hdfs supergroup 0 2017-07-03 11:04 / user/hdfs/test2
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.