Apache Hadoop for Windows Platform
http://www.codeproject.com/Articles/757934/Apache-Hadoop-for-Windows-Platform
Build, Install, Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS
http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os
///////////////
ОтветитьУдалитьhadoop fs -mkdir /in
hadoop fs -mkdir /out
hadoop fs -copyFromLocal c:\Hwork\recipeitems-latest.json /in
hadoop jar c:\Hwork\Recipe.jar Recipe /in /out
hadoop fs -ls /out
hadoop fs -cat /out/part-r-00000
hadoop fs -ls /in
start hadoop jar c:\Hwork\Recipe.jar Recipe /in /out
///////////////
javac -classpath C:\hadoop-2.3.0\share\hadoop\common\hadoop-common-2.3.0.jar;C:\hadoop-2.3.0\share\hadoop\mapreduce\hadoop-mapreduce-client-core-2.3.0.jar;C:\hadoop-2.3.0\share\hadoop\common\lib\gson-2.2.4.jar;C:\hadoop-2.3.0\share\hadoop\common\lib\commons-cli-1.2.jar Recipe.java
jar -cvf Recipe.jar *.class
///////////////
- hadoop
- hadooop conf
- HADOOP_HOME
- PATH <- Hadoop/bin
-- JAVA_HOME
-- java/bin -> path
- etc\hadoop\hadoop_env.cfg
-- java_home
- cd hadoop/bin
-- hadoop
-- hadoop namenode -format
--- c:\hadoop -- data
- cd hadoop/sbin
-- start-yarn
-- start-dfs
-c:\hwork
-- java
-- json
--- javac Recipe.java
- google-gson
-- in hadoop/share/hadoop/common/lib/google-gson
- jar
- hadoop fs -mkdir /in
- hadoop fs -copyFromLocal json
- hadoop fs -ls /in
- hadoop jar
- hadoop fs -ls /out
- hadoop fs -cat /out/part-r-00000
- localhost:50070
///////////////////////////////////
15/03/12 15:05:08 INFO mapreduce.Job: map 0% reduce 0%
ОтветитьУдалить15/03/12 15:05:16 INFO mapreduce.Job: Task Id : attempt_1426165389823_0002_m_000
000_0, Status : FAILED
Error: java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.FileS
plit cannot be cast to org.apache.hadoop.mapred.InputSplit
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:403)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInforma
tion.java:1548)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)