1. HDFS Commands
List Files and Directories
hdfs dfs -ls /path/to/directory
Create a Directory
hdfs dfs -mkdir /path/to/directory
Copy a File to HDFS
hdfs dfs -put localfile.txt /hdfs/path/
Copy a File from HDFS to Local
hdfs dfs -get /hdfs/path/file.txt localfile.txt
Remove a File or Directory
hdfs dfs -rm /hdfs/path/file.txt # Remove file
hdfs dfs -rm -r /hdfs/path/dir # Remove directory
Check Disk Usage
hdfs dfs -du -h /hdfs/path/
Display File Content
hdfs dfs -cat /hdfs/path/file.txt
2. Hadoop MapReduce Commands
Run a MapReduce Job
hadoop jar /path/to/jarfile.jar MainClass input_path output_path
View Job Status
hadoop job -status <job_id>
Kill a Running Job
hadoop job -kill <job_id>
3. Hadoop Cluster Management Commands
Start and Stop Hadoop
start-dfs.sh # Start HDFS
start-yarn.sh # Start YARN
stop-dfs.sh # Stop HDFS
stop-yarn.sh # Stop YARN
Check Running Hadoop Services
jps
4. YARN Commands
List Running Applications
yarn application -list
Kill an Application
yarn application -kill <application_id>
Check Node Status
yarn node -list
5. HBase Commands
Start and Stop HBase
start-hbase.sh # Start HBase
stop-hbase.sh # Stop HBase
Connect to HBase Shell
hbase shell
List Tables
list
Describe a Table
describe 'table_name'
Scan Table Data
scan 'table_name'
Drop a Table
disable 'table_name'
drop 'table_name'
6. ZooKeeper Commands
Start and Stop ZooKeeper
zkServer.sh start # Start ZooKeeper
zkServer.sh stop # Stop ZooKeeper
Check ZooKeeper Status
zkServer.sh status
Connect to ZooKeeper CLI
zkCli.sh
7. Miscellaneous Commands
Check Hadoop Version
hadoop version
Check HDFS Storage Summary
hdfs dfsadmin -report
Check Hadoop Configuration
hadoop conf -list
No comments:
Post a Comment