◢ <[wiki:Hinet131022/Lab20 實作二十]> | <[wiki:Hinet131022 回課程大綱]> ▲ | <[wiki:Hinet131022/Lab22 實作二十二] > ◣
= 實作二十一 Lab21 =
{{{
#!html
修改檔案輸入格式
KeyValueTextInputFormat
}}}
[[PageOutline]]
{{{
#!text
請先連線至 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>