本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
获得 Apache ZooKeeper Amazon MSK 集群的连接字符串
获得 Apache ZooKeeper 连接字符串使用Amazon Web Services Management Console
从打开 Amazon MSK 控制台https://console.amazonaws.cn/msk/
. -
该表显示了此账户下当前区域的所有集群。选择集群名称以查看其说明。
-
在存储库的集群摘要页面上,选择查看客户端信息. 这将显示引导代理,和 Apache ZooKeeper 连接字符串。
获得 Apache ZooKeeper 连接字符串使用Amazon CLI
如果您不知道集群的 Amazon 资源名称 (ARN),您可以通过列出您账户中的所有集群来找到它。有关更多信息,请参阅 列出 Amazon MSK 集群。
-
为了得到 Apache ZooKeeper 连接字符串和有关集群的其他信息,运行以下命令,并将
ClusterArn与集群的 ARN。aws kafka describe-cluster --cluster-arnClusterArn该
describe-cluster命令的输出如以下 JSON 示例所示。{ "ClusterInfo": { "BrokerNodeGroupInfo": { "BrokerAZDistribution": "DEFAULT", "ClientSubnets": [ "subnet-0123456789abcdef0", "subnet-2468013579abcdef1", "subnet-1357902468abcdef2" ], "InstanceType": "kafka.m5.large", "StorageInfo": { "EbsStorageInfo": { "VolumeSize": 1000 } } }, "ClusterArn": "arn:aws:kafka:us-east-1:111122223333:cluster/testcluster/12345678-abcd-4567-2345-abcdef123456-2", "ClusterName": "testcluster", "CreationTime": "2018-12-02T17:38:36.75Z", "CurrentBrokerSoftwareInfo": { "KafkaVersion": "2.2.1" }, "CurrentVersion": "K13V1IB3VIYZZH", "EncryptionInfo": { "EncryptionAtRest": { "DataVolumeKMSKeyId": "arn:aws:kms:us-east-1:555555555555:key/12345678-abcd-2345-ef01-abcdef123456" } }, "EnhancedMonitoring": "DEFAULT", "NumberOfBrokerNodes": 3, "State": "ACTIVE", "ZookeeperConnectString": "10.0.1.101:2018,10.0.2.101:2018,10.0.3.101:2018" } }上一 JSON 示例在
describe-cluster命令输出中显示ZookeeperConnectString键。复制与此键对应的值,并保存它以用于在集群上创建主题。重要 您的 Amazon MSK 集群必须位于
ACTIVE状态,你才能获得 Apache ZooKeeper 连接字符串。当集群仍处于CREATING状态时,describe-cluster命令的输出不包含ZookeeperConnectString。如果发生这种情况,请等待几分钟,然后在集群进入ACTIVE状态后再次运行describe-cluster。
获得 Apache ZooKeeper 使用 API 的连接字符串
为了得到 Apache ZooKeeper 使用 API 的连接字符串,请参阅DescribeCluster.