无法在亚马逊 emr 中使用 apache flink

Cannot use apache flink in amazon emr

我无法在 Amazon 的 EMR 中启动 Apache Flink 的 yarn 会话。我收到的错误信息是

$ tar xvfj flink-0.9.0-bin-hadoop26.tgz
$ cd flink-0.9.0
$ ./bin/yarn-session.sh -n 4 -jm 1024 -tm 4096
...
Diagnostics: File file:/home/hadoop/.flink/application_1439466798234_0008/flink-conf.yaml does not exist
java.io.FileNotFoundException: File file:/home/hadoop/.flink/application_1439466798234_0008/flink-conf.yaml does not exist
...

我使用的是 Flink version 0.9 和 Amazons Hadoop version 4.0.0。有什么想法或提示吗?

完整的日志可以在这里找到:https://gist.github.com/headmyshoulder/48279f06c1850c62c28c

来自日志:

The file system scheme is 'file'. This indicates that the specified Hadoop configuration path is wrong and the sytem is using the default Hadoop configuration values.The Flink YARN client needs to store its files in a distributed file system

Flink读取Hadoop配置文件失败。它们要么从环境变量中获取,例如HADOOP_HOME,或者您可以在执行 YARN 命令之前在 flink-conf.yaml 中设置配置目录。

Flink需要读取Hadoop配置才能知道如何将Flink jar上传到集群文件系统,以便新创建的YARN集群可以访问它。如果 Flink 无法解析 Hadoop 配置,它会使用本地文件系统上传 jar。这意味着 jar 将被放置在您启动集群的机器上。因此,无法从 Flink YARN 集群访问它。

请参阅 Flink configuration page 了解更多信息。

编辑:在 Amazong EMR 上,export HADOOP_CONF_DIR=/etc/hadoop/conf 让 Flink 发现 Hadoop 配置目录。

如果我是你我会试试这个:

./bin/yarn-session.sh -n 1 -jm 768 -tm 768