本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定 Amazon S3 接收器連接器
此範例示範如何使用 Confluent Amazon S3 接收器連接器
-
複製以下內容JSON並將其貼到新的檔案中。將預留位置字串取代為與您 Amazon MSK叢集的引導伺服器連線字串和叢集的子網路和安全群組 相對應的值IDs。如需有關如何設定服務執行角色的詳細資訊,請參閱 IAM MSK Connect 的角色和政策。
{ "connectorConfiguration": { "connector.class": "io.confluent.connect.s3.S3SinkConnector", "s3.region": "us-east-1", "format.class": "io.confluent.connect.s3.format.json.JsonFormat", "flush.size": "1", "schema.compatibility": "NONE", "topics": "my-test-topic", "tasks.max": "2", "partitioner.class": "io.confluent.connect.storage.partitioner.DefaultPartitioner", "storage.class": "io.confluent.connect.s3.storage.S3Storage", "s3.bucket.name": "my-test-bucket" }, "connectorName": "example-S3-sink-connector", "kafkaCluster": { "apacheKafkaCluster": { "bootstrapServers": "
<cluster-bootstrap-servers-string>
", "vpc": { "subnets": [ "<cluster-subnet-1>
", "<cluster-subnet-2>
", "<cluster-subnet-3>
" ], "securityGroups": ["<cluster-security-group-id>
"] } } }, "capacity": { "provisionedCapacity": { "mcuCount": 2, "workerCount": 4 } }, "kafkaConnectVersion": "2.7.1", "serviceExecutionRoleArn": "<arn-of-a-role-that-msk-connect-can-assume>
", "plugins": [ { "customPlugin": { "customPluginArn": "<arn-of-custom-plugin-that-contains-connector-code>
", "revision": 1 } } ], "kafkaClusterEncryptionInTransit": {"encryptionType": "PLAINTEXT"}, "kafkaClusterClientAuthentication": {"authenticationType": "NONE"} } -
在您在上一個步驟中儲存JSON檔案的資料夾中執行下列 AWS CLI 命令。
aws kafkaconnect create-connector --cli-input-json file://connector-info.json
以下是成功執行命令時所得到的輸出範例。
{ "ConnectorArn": "arn:aws:kafkaconnect:us-east-1:123450006789:connector/example-S3-sink-connector/abc12345-abcd-4444-a8b9-123456f513ed-2", "ConnectorState": "CREATING", "ConnectorName": "example-S3-sink-connector" }