wiki:Hinet131022/Lab21

◢ <實作二十> | <回課程大綱> ▲ | <實作二十二 > ◣

實作二十一 Lab21

修改檔案輸入格式
KeyValueTextInputFormat

請先連線至 nodeN.3du.me , N 為您的報名編號
cd ~/hadoop_labs/lab012
ant
mkdir -p kv_input
printf "A\t1\n" >  kv_input/input1
printf "B\t2\n" >> kv_input/input1
printf "C\t3\n" >> kv_input/input1
printf "A\t1\n" >  kv_input/input2
printf "C\t2\n" >> kv_input/input2
printf "B\t1\n" >> kv_input/input2
hadoop fs -put kv_input kv_input
hadoop jar WordCount.jar kv_input kv_output
hadoop fs -ls kv_output
hadoop fs -cat kv_output/part-*

export HADOOP_CONF_DIR=~/hadoop/conf.local/
hadoop jar WordCount.jar kv_input kv_output
ls -al kv_output
cat kv_output/part-*
unset HADOOP_CONF_DIR

實作習題

<問題 1>

Last modified 11 years ago Last modified on Oct 22, 2013, 4:58:47 PM