Spring-yarn跨平台FsShell问题

时间:2015-05-19 22:25:30

标签: java spring spring-boot yarn

我在GitHub举办的Spring YARN example工作。我有基本的项目shell工作;也就是说,从 Windows 客户端提交到远程Hadoop Linux 群集的工作正常,并且YARN容器代码已执行。在我的容器中,我正在按照示例中的建议对FsShell进行简单测试。

@Autowired
private Configuration configuration;

@OnContainerStart
public void containerStart() throws IOException {
  try (FsShell shell = new FsShell(configuration)) {
    for (FileStatus s : shell.ls(false, "/")) {
      log.info(s);
    }
  }
}

当容器代码执行时,我收到以下错误:

Application application_1427147939282_0014 failed 2 times due to AM Container for appattempt_1427147939282_0014_000002 exited with exitCode: 1 due to: Exception from container-launch.
Container id: container_1427147939282_0014_02_000001
Exit code: 1
Exception message: /bin/bash: line 0: fg: no job control
Stack trace: ExitCodeException exitCode=1: /bin/bash: line 0: fg: no job control
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:702)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:197)

据我所知,在将Windows客户端的作业提交到Linux时,这是一种众所周知的失败模式,并且它与从Windows传递环境有关。这在YARN container environment文档中暗示:

  

如果在不同系统之间传递环境变量,请小心。例如,如果在Windows上运行客户端并将变量传递给在Linux上运行的Application Master,则Yarn中的执行包装器可能会无声地失败。

在Spring reference中,用于使用基于注释的配置配置YARN,它指示如何使用注释设置YARN的配置。我已按指示添加了类(见下文),但据我所知,配置未被使用。我尝试了一些可以抛出异常的实验,但我从未看到任何变化。我已经包含了这段代码:

@Configuration
@EnableYarn(enable = Enable.CONTAINER)
public class ContainerConfiguration extends SpringYarnConfigurerAdapter {

  /** {@inheritDoc} */
  @Override
  public void configure(YarnEnvironmentConfigurer environment) throws Exception {
    super.configure(environment);
    environment.includeLocalSystemEnv(false);
  }
}

我是Spring-Boot和基于注释的配置样式的新手。任何指导将不胜感激。谢谢!

0 个答案:

没有答案