Hadoop 2.7.1 wordcount工作

时间:2016-01-03 02:55:39

标签: hadoop mapreduce hdfs

我在JDK 8上安装了hadoop 2.7.1并设置了HDFS ..running。在尝试运行wordcount作业时。我得到以下异常。任何帮助表示赞赏。

我深入到日志中找到了。

2016-01-02 20:42:17,220 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl: Diagnostics report from attempt_1451788850721_0002_m_000000_3: Exception from container-launch.
Container id: container_1451788850721_0002_01_000010
Exit code: 9009
**Exception message: 'MySQL' is not recognized as an internal or external command**,
operable program or batch file.
'MySQL' is not recognized as an internal or external command,
operable program or batch file.

Stack trace: ExitCodeException exitCode=9009: 'MySQL' is not recognized as an internal or external command,
operable program or batch file.
'MySQL' is not recognized as an internal or external command,
operable program or batch file.

    at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)
    at org.apache.hadoop.util.Shell.run(Shell.java:456)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Shell output:         1 file(s) moved.

3 个答案:

答案 0 :(得分:0)

未安装MySQL或环境变量中未设置MYSQL_HOME。安装MySQL或/并设置变量。

答案 1 :(得分:0)

外部变量区分大小写,因为“MySQL”和“mysql”是不同的。在命令行中键入MySQL,查看结果。

注意:导出环境变量和执行的jar必须来自同一个用户。

答案 2 :(得分:0)

您需要更改path变量中的MySQL路径以避免空格和一些不常见的符号,例如'&'在里面。

我改变了

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5

C:\PROGRA~2\MySQL\MYSQLF~1.5\

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP

C:\PROGRA~2\MySQL\MYSQLF~1.5\DOCTRI~1\

这解决了我的问题。