规格:
我还尝试按照Amazon MSK Library for AWS Identity and Access Management的建议添加IAM鉴别信息。它说要在config/client.properties中添加以下内容:
# Sets up TLS for encryption and SASL for authN.
security.protocol = SASL_SSL
# Identifies the SASL mechanism to use.
sasl.mechanism = AWS_MSK_IAM
# Binds SASL client implementation.
# sasl.jaas.config = software.amazon.msk.auth.iam.IAMLoginModule required;
# Encapsulates constructing a SigV4 signature based on extracted credentials.
# The SASL client bound by "sasl.jaas.config" invokes this class.
sasl.client.callback.handler.class = software.amazon.msk.auth.iam.IAMClientCallbackHandler
# Binds SASL client implementation. Uses the specified profile name to look for credentials.
sasl.jaas.config = software.amazon.msk.auth.iam.IAMLoginModule required awsProfileName="kafka-client";
kafka-client
是作为实例配置文件附加到 EC2 实例的 IAM 角色。
联网:我使用VPC可达性分析器来确认安全组配置正确,并且我作为生产者使用的EC2实例可以到达无服务器的MSK集群。
我想做的是:创造一个话题。
我的尝试方式:bin/kafka topics.sh--create--partitions 1--replication factor 1--topic quickstart events--bootstrap server boot-zclcyva3.c2.kafka serverless.us-east-2.amazonaws.com:9098
结果:
Error while executing topic command : Timed out waiting for a node assignment. Call: createTopics
[2022-01-17 01:46:59,753] ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: createTopics
(kafka.admin.TopicCommand$)
我也在尝试:使用明文端口9092。(9098是MSK中的IAM身份验证端口,无服务器MSK默认使用IAM身份验证。)
我在SO上找到的关于这个节点分配错误的所有其他帖子都不包括MSK。我尝试了一些建议,比如取消server.properties中侦听器设置的注释,但是这并没有改变任何事情。
安装 kcat
进行故障排除对我不起作用,因为 Amazon Linux 2 使用的 yum 包管理器没有开箱即用的安装,而且由于这些说明在检查 libcurl 时失败了(通过编译)......失败(失败)。
问题:还有其他解决这个“节点分配”错误的技巧吗?
文档最近已经更新了,我能够毫无问题地从头到尾地遵循它(IAM策略现在是正确的)
https://docs.aws.amazon.com/msk/latest/developerguide/serverless-getting-started.html
创建的属性文件不会自动使用;您的命令需要包含 --command-config client.properties
,其中此属性文件记录在链接的 IAM 页面上的 MSK 文档中。
提取。。。
ssl.truststore.location=<PATH_TO_TRUST_STORE_FILE>
security.protocol=SASL_SSL
sasl.mechanism=AWS_MSK_IAM
sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
或者,如果纯文本端口不起作用,那么您有其他网络问题
除了这些步骤之外,我建议联系 MSK 支持人员,并告诉他们更新“创建主题”页面以不再使用 Zookeeper,请记住 Kafka 3.0 尚未受支持