无法在 AWS MSK 中更新 kafka 集群版本

问题描述

我们已经编写了python代码升级AWS MSK中的kafka版本及其给出的错误


    ..................................................
    vaibhavkanchan@vkmacbook python-code % ./update_kafka_version.py /gpn-prime/dev/msk/kafka-cluster 2.6.1
    ..................................................
    Cluster ARN: arn:aws:kafka:ap-south-1:xxxx:cluster/xxx-mks-kafka-cluster/1bdb7d3d-f9be-4d51-bc69-82e1c7a280eb-4
    Current Version :K1X6FK5RDHNB96
    cluster name: xxx-msk-mks-kafka-cluster
    Configuration ARN: arn:aws:kafka:ap-south-1:xxxx:configuration/xxx-mks-kafka-cluster/bcc660ab-ecba-4ac3-afa6-2c6013d6debf-4
    Configuration Revision: 1
    Kafka current version: 2.2.1
    ..................................................
    Traceback (most recent call last):
    File "./update_kafka_version.py",line 71,in <module>
    update_kafka_version(name,targetKafkaVersion)
    File "./update_kafka_version.py",line 40,in update_kafka_version
    update_kafka_version_response = client.update_cluster_kafka_version(
    File "/usr/local/lib/python3.8/site-packages/botocore/client.py",line 357,in _api_call
    return self._make_api_call(operation_name,kwargs)
    File "/usr/local/lib/python3.8/site-packages/botocore/client.py",line 676,in _make_api_call
    raise error_class(parsed_response,operation_name)
    botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the UpdateClusterKafkaVersion operation: The specified parameter value is identical to the current value for the cluster. Specify a different value,then try again.
    
    vaibhavkanchan@vkmacbook python-code % aws kafka describe-cluster --cluster-arn arn:aws:kafka:ap-south-1:xxxx:cluster/xxx-mks-kafka-cluster/1bdb7d3d-f9be-4d51-bc69-82e1c7a280eb-4 --query "ClusterInfo.CurrentVersion"
    "K1X6FK5RDHNB96"
    vaibhavkanchan@vkmacbook python-code %

根据 kafka 的 boto3 文档

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kafka.html#Kafka.Client.update_cluster_kafka_version

response = client.update_cluster_kafka_version(
    Clusterarn='string',ConfigurationInfo={
        'Arn': 'string','Revision': 123
    },CurrentVersion='string',TargetKafkaVersion='string'
)

我们在参数存储中存储了 kafka zookeeper 端点、引导节点、集群 arn 和集群版本,并从参数存储中获取集群 arn。我们正在使用 describe-cluster 获取当前版本,但仍然给出指定当前版本与当前集群值匹配的错误

我的笔记本电脑中 boto3 的 python 模块

boto3 1.17.27 botocore 1.20.44

任何有关解决此问题的建议将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)