Thursday, December 17, 2015

Few useful Hadoop 2.6.2 commands

Below are few useful Hadoop (2.6.2) commands:

stop-yarn.sh

stop-dfs.sh

hadoop namenode -format

start-dfs.sh

#will list processes running in hadoop
jps

hdfs dfs -mkdir /user

hdfs dfs -mkdir /user/hduser

hdfs dfs -mkdir /user/hduser/wordcount

hdfs dfs -mkdir /user/hduser/wordcount/input

cd /usr/local/hadoop/temp_hduser

#copy file from local to hdfs
hdfs dfs -put input1.txt /user/hduser/wordcount/input/file0
hdfs dfs -put input1.txt /user/hduser/wordcount/input/file1

start-yarn.sh

#For removing dirs if you have
hdfs  dfs -rmr /user/hduser/wordcount/output

#Run your jar will read everything from the input dir, below will not work if Yarn is not started :)
hadoop jar chainingmapper.jar  /user/hduser/wordcount/input /user/hduser/wordcount/output

No comments:

Post a Comment