Hadoop Study Note 1-1

xianglongkong@xianglokongsmbp:/usr/local/Cellar/hadoop/1.2.1/libexec$ bin/hadoop jar /usr/local/Cellar/hadoop/1.2.1/libexec/hadoop-examples-1.2.1.jar pi 10 100

Number of Maps  = 10

Samples per Map = 100

java.lang.RuntimeException: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused

at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:567)

at org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:318)

at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:265)

at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342)

Solution:

xianglongkong@xianglokongsmbp:/usr/local/Cellar/hadoop/1.2.1/libexec$ bin/hadoop namenode -format

xianglongkong@xianglokongsmbp:/usr/local/Cellar/hadoop/1.2.1/libexec$ bin/start-all.sh

starting namenode, logging to /usr/local/Cellar/hadoop/1.2.1/libexec/bin/../logs/hadoop-xianglongkong-namenode-xianglokongsmbp.out

localhost: starting datanode, logging to /usr/local/Cellar/hadoop/1.2.1/libexec/bin/../logs/hadoop-xianglongkong-datanode-xianglokongsmbp.out

localhost: starting secondarynamenode, logging to /usr/local/Cellar/hadoop/1.2.1/libexec/bin/../logs/hadoop-xianglongkong-secondarynamenode-xianglokongsmbp.out

starting jobtracker, logging to /usr/local/Cellar/hadoop/1.2.1/libexec/bin/../logs/hadoop-xianglongkong-jobtracker-xianglokongsmbp.out

localhost: starting tasktracker, logging to /usr/local/Cellar/hadoop/1.2.1/libexec/bin/../logs/hadoop-xianglongkong-tasktracker-xianglokongsmbp.out

xianglongkong@xianglokongsmbp:/usr/local/Cellar/hadoop/1.2.1/libexec$ jps

2372 DataNode

2537 JobTracker

2630 TaskTracker

2277 NameNode

2665 Jps

2468 SecondaryNameNode

xianglongkong@xianglokongsmbp:/usr/local/Cellar/hadoop/1.2.1/libexec$ bin/hadoop jar /usr/local/Cellar/hadoop/1.2.1/libexec/hadoop-examples-1.2.1.jar pi 10 100

—————————————————————————————-

Question:

hadoop fs -copyFromLocal ~/Desktop/hadoopTest.txt hdfs://localhost/user/tom/quangle.txt does not work

Answer:

ellipsis URI hdfs://localhost

hadoop fs -copyFromLocal ~/Desktop/hadoopTest.txt /user/tom/quangle.txt

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s