https://github.com/listen180/hadoop-notes
https://github.com/listen180/hadoop-notes
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/listen180/hadoop-notes
- Owner: Listen180
- Created: 2019-03-14T08:05:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T09:16:10.000Z (over 7 years ago)
- Last Synced: 2025-01-12T22:32:58.582Z (over 1 year ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hadoop Notes
## Some commonly used commands
查看集群上的分布式存储文件:
```shell
$ hadoop fs -text {path-to-file} | head
```
将结果保存到本地文件系统(指的是连接hadoop集群的机器):
```shell
$ hadoop fs -get {path-to-file} {save-path}
$ hadoop fs -getmerge {path-to-file-part*} {save-path}
```
Kill hadoop任务:
```shell
$ hadoop job -kill {job_id}
$ yarn application -kill {application_id}
```
删除已有的集群上目标文件目录(当存在同样的目标目录时,hadoop执行时会自动放弃执行):
```shell
$ hadoop fs -rm -r {path-to-folder}
```
查看集群上文件的行数:
```shell
$ hadoop fs -cat {path-to-file} | wc -l
```