flink用presto写入s3

pexxcrt2  于 2021-06-24  发布在  Flink
关注(0)|答案(1)|浏览(800)

我想使用presto接口和bucketingsink从flink1.4.2写入s3。我按照说明添加了flink-conf.yamls3.access-key和s3.secret-key,并将flink-s3-fs-presto-1.4.2.jar放在lib文件夹中。下面是产生的错误。
如果作业是在aws环境中执行的,我希望我根本不需要设置密钥。我认为这个假设是正确的。

java.lang.IllegalArgumentException: AWS Access Key ID and Secret Access Key must be specified as the username or password (respectively) of a s3 URL, or by setting the fs.s3.awsAccessKeyId or fs.s3.awsSecretAccessKey properties (respectively).
at org.apache.hadoop.fs.s3.S3Credentials.initialize(S3Credentials.java:70)
at org.apache.hadoop.fs.s3.Jets3tFileSystemStore.initialize(Jets3tFileSystemStore.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:191)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
at com.sun.proxy.$Proxy17.initialize(Unknown Source)
at org.apache.hadoop.fs.s3.S3FileSystem.initialize(S3FileSystem.java:91)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.createHadoopFileSystem(BucketingSink.java:1206)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.initFileSystem(BucketingSink.java:411)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.initializeState(BucketingSink.java:355)
at org.apache.flink.streaming.util.functions.StreamingFunctionUtils.tryRestoreFunction(StreamingFunctionUtils.java:178)
at org.apache.flink.streaming.util.functions.StreamingFunctionUtils.restoreFunctionState(StreamingFunctionUtils.java:160)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.initializeState(AbstractUdfStreamOperator.java:96)
at org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:258)
at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeOperators(StreamTask.java:694)
at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeState(StreamTask.java:682)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:253)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
at java.lang.Thread.run(Thread.java:748)
5vf7fwbs

5vf7fwbs1#

应用程序似乎没有使用 flink-s3-fs-presto 不过,hadoop已经弃用了旧的s3文件系统。粘贴的堆栈跟踪表明 flink-s3-fs-presto 没有为文件系统方案“s3://”拾取。
请确保 flink-s3-fs-presto jar文件真的在 lib 执行作业的TaskManager的文件夹,而不仅仅是在客户端上。
当您使用yarn或mesos部署flink作业时,应该会自动发生这种情况。
通过容器部署flink时,请确保jar文件位于容器映像的lib文件夹中。
单独或手动运行flink taskmanagers时,请确保集群中的所有taskmanagers在启动前都将jar文件放在lob文件夹中。

相关问题