获得服务:AmazonKinesis;状态码:502,带有apache-flink和localstack Kinesis [英] Getting Service: AmazonKinesis; Status Code: 502 with apache-flink and localstack Kinesis

查看:207
本文介绍了获得服务:AmazonKinesis;状态码:502,带有apache-flink和localstack Kinesis的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地设置由运行cinesis服务的local apache-flink(通过brew安装)和localstack组成.

My local setup consists of local apache-flink (installed via brew) and localstack with the Kinesis service running.

我的docker-compose有

my docker-compose has

  localstack:
    image: localstack/localstack:0.10.7
    environment:
      - SERVICES=kinesis
    ports:
      - "4568:4568"

和我的Kinesis使用者:

and my Kinesis Consumer:

kinesisConsumerConfig.setProperty(ConsumerConfigConstants.AWS_ACCESS_KEY_ID, "123");
kinesisConsumerConfig.setProperty(ConsumerConfigConstants.AWS_SECRET_ACCESS_KEY, "123");
kinesisConsumerConfig.setProperty(ConsumerConfigConstants.AWS_ENDPOINT, "http://localhost:4568");

但是当我运行Flink程序时,出现此错误:

but when I run the Flink program I get this error:

起因: org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.AmazonKinesisException: null(服务:AmazonKinesis;状态代码:502;错误代码:null; 请求ID:空)

Caused by: org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.AmazonKinesisException: null (Service: AmazonKinesis; Status Code: 502; Error Code: null; Request ID: null)

它仅在使用localstack时发生.如果我通过我的AWS账户连接到我的Kinesis流,则可以正常运行.

It only happens when using localstack. If I connect to my Kinesis stream on my AWS account it works perfectly.

推荐答案

原来,我们需要通过ENV var禁用cbor和cert检查,并在同一控制台中启动flink

Turns out we need to disable cbor and cert checking via ENV var and start flink in the same console

export AWS_CBOR_DISABLE=1
DISABLE_CERT_CHECKING_JAVA_OPTS="-Dorg.apache.flink.kinesis.shaded.com.amazonaws.sdk.disableCertChecking"
export FLINK_ENV_JAVA_OPTS=${DISABLE_CERT_CHECKING_JAVA_OPTS}
/usr/local/Cellar/apache-flink/1.9.1/libexec/bin/start-cluster.sh

这篇关于获得服务:AmazonKinesis;状态码:502,带有apache-flink和localstack Kinesis的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆