// Module included in the following assemblies:
// assembly-management-tasks.adoc

[id='proc-manual-restart-mirrormaker2-connector-{context}']
= Manually restarting MirrorMaker 2 connectors

[role="_abstract"]
Use the `strimzi.io/restart-connector` annotation to manually trigger a restart of a MirrorMaker 2 connector.

.Prerequisites

* The Cluster Operator is running.

.Procedure

. Find the name of the `KafkaMirrorMaker2` custom resource that controls the Kafka MirrorMaker 2 connector you want to restart:
+
[source,shell,subs="+quotes"]
----
kubectl get KafkaMirrorMaker2
----

. Find the name of the Kafka MirrorMaker 2 connector to be restarted from the `KafkaMirrorMaker2` custom resource:
+
[source,shell,subs="+quotes"]
----
kubectl describe KafkaMirrorMaker2 <mirrormaker_cluster_name>
----

. Use the name of the connector to restart the connector by annotating the `KafkaMirrorMaker2` resource in Kubernetes:
+
[source,shell,subs="+quotes"]
----
kubectl annotate KafkaMirrorMaker2 <mirrormaker_cluster_name> "strimzi.io/restart-connector=<mirrormaker_connector_name>"
----
+
In this example, connector `source-cluster->target-cluster.MirrorCheckpointConnector` in the `my-mirror-maker-2` cluster is restarted:
+
[source,shell,subs="+quotes"]
----
kubectl annotate KafkaMirrorMaker2 my-mirror-maker-2 "strimzi.io/restart-connector=source-cluster->target-cluster.MirrorCheckpointConnector"
----
+
You can also refine the restart behavior with the `includeTasks` and `onlyFailed` parameters, which both default to `false`.  
+
--
* `includeTasks` restarts both the connector instance and its task instances.  
* `onlyFailed` restarts only instances with a `FAILED` status when set to `true`.  
--
+
Separate the connector name and the parameters with a colon (`:`). 
For example: 
+
[source,shell]
----
kubectl annotate KafkaMirrorMaker2 my-mirror-maker-2 "strimzi.io/restart-connector=source-cluster->target-cluster.MirrorCheckpointConnector:includeTasks,onlyFailed"
----

. Wait for the next reconciliation to occur (every two minutes by default).
+
The MirrorMaker 2 connector is restarted, as long as the annotation was detected by the reconciliation process.
When MirrorMaker 2 accepts the request, the annotation is removed from the `KafkaMirrorMaker2` custom resource.
