问题 :
1、ecliplse 远程提交程序到虚拟机 hadoop集群 ,运行wordcount程序有问题,又没有提示 ,当时 下载了 windows 32的 winutils.exe hadoop.dll,以为解决了
2、ecliplse 远程提交程序到虚拟机 hadoop集群 ,运行天气预报 程序temperature又有问题,但ecliplse无显示 ,不知道哪里有问题了?
直接打成jar在hadoop运行ok,程序没有问题。
3、百思不得其解,百度
4、先 解决 ecliplse日志输出问题
在src目录下新建一个文件: log4j.properties 复制一下信息到文件中,保存即可
log4j.rootLogger=info,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#dwr log config
log4j.logger.uk.ltd.getahead.dwr=
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%c:%L) %d{yyyy-MM-dd HH:mm:ss,SSS} ---- %m%n
#log4j.appender.R=org.apache.log4j.RollingFileAppender
#log4j.appender.R.File=D:\\logs\\web_log.log
#log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
#log4j.appender.R.MaxBackupIndex=100
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %d{yyyy-MM-dd HH\:mm\:ss,SSS} %n%t %c ---- %m%n
#disable dwr log
#log4j.logger.org.directwebremoting=ERROR
5、再次运行 ,终于 显示错误了,是权限问题 ,这就简单了,放开权限
[root@master hadoop]#hadoop dfs -chmod 777 /temperature
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
16/02/10 21:33:12 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
[root@master hadoop]#hadoop dfs -ls /temperature
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
16/02/10 21:33:17 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 2 items
-rw-r--r-- 1 root supergroup 454 2016-02-10 18:49 /temperature/data.txt
drwxr-xr-x - root supergroup 0 2016-02-10 19:40 /temperature/output
[root@master hadoop]#
6、运行ok,日志也打印出来了 !!激动幸福的时刻!!!