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

2024-05-29 12:08:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我们已经编写了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 %

根据卡夫卡的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。我们正在使用descripe cluster获取当前版本,但它仍然给出指定的当前版本与当前集群值匹配的错误

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

boto3 1.17.27 botocore 1.20.44

如有任何关于解决此问题的建议,我们将不胜感激


Tags: kafkanameinpy版本awsversionline

热门问题