Update integration configurations for Aiven for Apache Kafka® MirrorMaker 2
Update the producer and consumer settings on a MirrorMaker 2 service integration to control how MirrorMaker 2 communicates with the source and target Kafka clusters.
Integration configurations are set on the service integration resource. For more information about available parameters and restart impact, see Configuration and tuning for Aiven for Apache Kafka® MirrorMaker 2.
Integration configurations are not available in the Aiven Console. Use the Aiven CLI, Aiven API, or Aiven Provider for Terraform to update them.
Prerequisites
- An Aiven for Apache Kafka® MirrorMaker 2 service.
- An existing integration between the MirrorMaker 2 service and a source or target Kafka cluster.
- Access to one of the following:
Update integration configurations
Producer and consumer settings are stored on each kafka_mirrormaker service
integration. This applies whether the integration connects MirrorMaker 2 to an
Aiven for Apache Kafka® service or to an external Kafka cluster through an
integration endpoint.
- Aiven CLI
- Terraform
- Aiven API
Use avn service integration-update
to update producer and consumer settings on a MirrorMaker 2 integration.
-
List the service integrations for the MirrorMaker 2 service:
avn service integration-list MIRRORMAKER_SERVICE_NAME \
--project PROJECT_NAME -
Copy the service integration ID for the
kafka_mirrormakerintegration that connects MirrorMaker 2 to the source or target cluster you want to configure. -
Update the integration configuration.
To update settings, use
-c KEY=VALUEfor individual parameters or--user-config-jsonfor a JSON payload. Pass multiple-coptions to update several settings at once. Do not use-cand--user-config-jsonin the same command.avn service integration-update SERVICE_INTEGRATION_ID \
--project PROJECT_NAME \
-c kafka_mirrormaker.consumer_fetch_min_bytes=1024 \
-c kafka_mirrormaker.producer_linger_ms=100
Parameters:
PROJECT_NAME: Your Aiven project nameMIRRORMAKER_SERVICE_NAME: Your Aiven for Apache Kafka MirrorMaker 2 service nameSERVICE_INTEGRATION_ID: Thekafka_mirrormakerservice integration ID
-
Update the
kafka_mirrormaker_user_configblock in youraiven_service_integrationresource:resource "aiven_service_integration" "mirrormaker" {
project = "PROJECT_NAME"
integration_type = "kafka_mirrormaker"
source_service_name = "KAFKA_SERVICE_NAME"
destination_service_name = "MIRRORMAKER_SERVICE_NAME"
kafka_mirrormaker_user_config {
kafka_mirrormaker {
consumer_fetch_min_bytes = 1024
producer_linger_ms = 100
}
}
}Parameters:
PROJECT_NAME: Your Aiven project nameKAFKA_SERVICE_NAME: The Aiven for Apache Kafka® service connected to MirrorMaker 2. For an external Kafka cluster, usesource_endpoint_idinstead ofsource_service_name.MIRRORMAKER_SERVICE_NAME: Your Aiven for Apache Kafka MirrorMaker 2 service name
-
Run
terraform planandterraform applyto apply the changes.
-
List the service integrations for the MirrorMaker 2 service using the ServiceIntegrationList endpoint and copy the
service_integration_idfor thekafka_mirrormakerintegration. -
Call the ServiceIntegrationUpdate endpoint to update the integration configuration:
curl --request PUT \
--url https://api.aiven.io/v1/project/PROJECT_NAME/integration/INTEGRATION_ID \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"user_config": {
"kafka_mirrormaker": {
"consumer_fetch_min_bytes": 1024,
"producer_linger_ms": 100
}
}
}'Parameters:
PROJECT_NAME: Your Aiven project nameINTEGRATION_ID: The service integration IDAPI_TOKEN: Your personal token
For the full request schema and supported parameters, see the Aiven API reference and the
kafka_mirrormaker_user_configTerraform schema.
Verify the configuration
Check that the updated values are applied.
- Aiven CLI
- Terraform
- Aiven API
-
List each
kafka_mirrormakerintegration and itsuser_config:avn service get MIRRORMAKER_SERVICE_NAME \
--project PROJECT_NAME --json | \
jq '[.service_integrations[] | select(.integration_type == "kafka_mirrormaker") | {service_integration_id, user_config}]'Example output:
[
{
"service_integration_id": "1c2c30f8-413b-4c7c-b393-97165d875952",
"user_config": {
"cluster_alias": "my-kafka-endpoint-sasl"
}
},
{
"service_integration_id": "57042a2e-aae3-4be3-bcfc-e2c1294b1af3",
"user_config": {
"cluster_alias": "my-kafka"
}
},
{
"service_integration_id": "a89ca005-e9f1-46a9-9ffb-9f85c517323a",
"user_config": {
"cluster_alias": "my-kafka-endpoint-ssl",
"kafka_mirrormaker": {
"consumer_fetch_min_bytes": 1024,
"producer_linger_ms": 100
}
}
}
] -
Find the
service_integration_idyou updated and confirm that thekafka_mirrormakerblock underuser_configcontains your updated values.
Run terraform plan and confirm that Terraform reports no changes:
terraform plan
Use the ServiceIntegrationGet endpoint to retrieve the service integration and confirm that the updated values are applied.
Related pages