我正在尝试为我的 Flink 程序部署一个生产集群。我正在使用安装了 Flink 1.3.2 的标准 hadoop-core EMR 集群,使用 YARN 运行它。
我正在尝试配置我的 RocksDB 以将我的检查点写入 S3 存储桶。我正在尝试浏览这些文档:https ://ci.apache.org/projects/flink/flink-docs-release-1.3/setup/aws.html#set-s3-filesystem 。问题似乎是使依赖项正常工作。尝试运行程序时收到此错误:
java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.addResource(Lorg/apache/hadoop/conf/Configuration;)V
at com.amazon.ws.emr.hadoop.fs.EmrFileSystem.initialize(EmrFileSystem.java:93)
at org.apache.flink.runtime.fs.hdfs.HadoopFileSystem.initialize(HadoopFileSystem.java:328)
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:350)
at org.apache.flink.core.fs.FileSystem.get(FileSystem.java:389)
at org.apache.flink.core.fs.Path.getFileSystem(Path.java:293)
at org.apache.flink.runtime.state.filesystem.FsCheckpointStreamFactory.<init>(FsCheckpointStreamFactory.java:99)
at org.apache.flink.runtime.state.filesystem.FsStateBackend.createStreamFactory(FsStateBackend.java:282)
at org.apache.flink.contrib.streaming.state.RocksDBStateBackend.createStreamFactory(RocksDBStateBackend.java:273
我已经尝试离开和调整 core-site.xml 并保持原样。我尝试将 设置为HADOOP_CLASSPATH
包含/usr/lib/hadoop/share
(我假设是)上述指南中描述的大多数 JAR。我尝试下载 hadoop 2.7.2 二进制文件,并将它们复制到 flink/libs 目录中。所有导致相同的错误。
有没有人成功让 Flink 能够在 EMR 上写入 S3?
编辑:我的集群设置
AWS 门户:
1) EMR -> Create Cluster
2) Advanced Options
3) Release = emr-5.8.0
4) Only select Hadoop 2.7.3
5) Next -> Next -> Next -> Create Cluster ( I do fill out names/keys/etc)
集群启动后,我 ssh 进入 Master 并执行以下操作:
1 wget http://apache.claz.org/flink/flink-1.3.2/flink-1.3.2-bin-hadoop27-scala_2.11.tgz
2 tar -xzf flink-1.3.2-bin-hadoop27-scala_2.11.tgz
3 cd flink-1.3.2
4 ./bin/yarn-session.sh -n 2 -tm 5120 -s 4 -d
5 Change conf/flink-conf.yaml
6 ./bin/flink run -m yarn-cluster -yn 1 ~/flink-consumer.jar
我的 conf/flink-conf.yaml 我添加了以下字段:
state.backend: rocksdb
state.backend.fs.checkpointdir: s3:/bucket/location
state.checkpoints.dir: s3:/bucket/location
我的程序的检查点设置:
env.enableCheckpointing(getCheckpointRate,CheckpointingMode.EXACTLY_ONCE)
env.getCheckpointConfig.enableExternalizedCheckpoints(ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION)
env.getCheckpointConfig.setMinPauseBetweenCheckpoints(getCheckpointMinPause)
env.getCheckpointConfig.setCheckpointTimeout(getCheckpointTimeout)
env.getCheckpointConfig.setMaxConcurrentCheckpoints(1)
env.setStateBackend(new RocksDBStateBackend("s3://bucket/location", true))
如果您认为我缺少任何步骤,请告诉我