Hadoop 常用命令
# 查看HDFS文件列表
hadoop fs -ls /usr/local/log/
# 创建文件目录
hadoop fs -mkdir /usr/local/log/test
# 删除文件
/hadoop fs -rm /usr/local/log/07
# 上传一个本机文件到HDFS中/usr/local/log/目录下
adoop fs -put /usr/local/src/infobright-4.0.6-0-x86_64-ice.rpm /usr/local/log/
# 下载
hadoop fs –get /usr/local/log/infobright-4.0.6-0-x86_64-ice.rpm /usr/local/src/
# 查看文件
hadoop fs -cat /usr/local/log/zabbix/access.log.zabbix
# 查看HDFS基本使用情况
# hadoop dfsadmin -report
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
Configured Capacity: 29565767680 (27.54 GB)
Present Capacity: 17956433920 (16.72 GB)
DFS Remaining: 17956405248 (16.72 GB)
DFS Used: 28672 (28 KB)
DFS Used%: 0.00%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
-------------------------------------------------
Live datanodes (1):
Name: 127.0.0.1:50010 (localhost)
Hostname: ocean-lab.ocean.org
Decommission Status : Normal
Configured Capacity: 29565767680 (27.54 GB)
DFS Used: 28672 (28 KB)
Non DFS Used: 11609333760 (10.81 GB)
DFS Remaining: 17956405248 (16.72 GB)
DFS Used%: 0.00%
DFS Remaining%: 60.73%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Thu Dec 24 09:52:14 CST 2015
自此,你已经掌握 Hadoop 的配置和基本使用了。
更多Hadoop相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-12/126742.htm
