Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Shell operation of HDFS (notes)

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

* basic operation (single cluster): *

1. Create folder command

[hadoop@master] $hadoop fs-mkdir-p / 20191021

2. Upload file command

[hadoop@master ~] $hadoop fs-put test.txt / 20191021

3. View file command

[hadoop@master ~] $hadoop fs-cat / 20191021/test.txt

4. File copy command (copy to local)

[hadoop@master ~] $hadoop fs-get / 20191021/test.txt

5. Check the file directory under the directory

[hadoop@master ~] $hadoop fs-ls / 20191021

6. Delete file command

[hadoop@master ~] $hadoop fs-rm / 20191021/test.txt

7. Delete folder command

[hadoop@master ~] $hadoop fs-rmr / 20191021

Common operation commands for administrators:

1. View the running Job

[hadoop@master ~] $hadoop job-list

2. Close the running Job

[hadoop@master ~] $hadoop job-kill (name of the running job)

3. Check the status of the HDFS block to see if it is damaged

[hadoop@master ~] $hadoop fsck

4. Check the status of HDFS blocks and delete damaged blocks

[hadoop@master ~] $hadoop fsck /-delete

5. Check the status of HDFS blocks, including DataNode information

[hadoop@master ~] $hadoop dfsadmin-report

6. Hadoop enters safe mode

[hadoop@master ~] $hadoop dfsadmin-safemode enter

7. Hadoop leaves safe mode

[hadoop@master ~] $hadoop dfsadmin-safemode leave

8. Balance the files in the cluster

[hadoop@master hadoop] $sbin/start-balancer.sh

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report