.Create a file to prevent installing ActiveMQ features on Minion start-up
[source, console]
----
sudo vi etc/featuresBoot.d/disable-activemq.boot
----

.Add the following lines to disable ActiveMQ features and save the file
[source, disable-activemq.boot]
----
!minion-jms
!opennms-core-ipc-jms
----

.Create a file to install Kafka features on Minion startup
[source, console]
----
sudo vi etc/featuresBoot.d/kafka.boot
----

.Add the following lines to install the remote producer call (RPC), sink, and twin feature for Kafka on Minion startup and save the file
[source, kafka.boot]
----
opennms-core-ipc-kafka
----

.Configure the Kafka features and the Minion location via the Karaf shell
[source, console]
----
ssh -p 8201 admin@localhost
----

.Configure the Minion location
[source, karaf]
----
config:edit org.opennms.minion.controller<1>
config:property-set location my-location<2>
config:update<3>
----

<1> Edit the Minion configuration.
<2> Replace my-location with a location name that represents the remote location where the Minion is running.
<3> Save the configuration.

By default, the Minion generates a unique ID.
Provide a human-readable Minion identifier yourself with `config:property-set id my-minion-name`.

.Configure the Kafka endpoints for IPC feature
[source, karaf]
----
config:edit org.opennms.core.ipc.kafka
config:property-set bootstrap.servers my-kafka-ip-1:9092,my-kafka-ip-2:9092<1>
config:update
----

<1> Adjust the IPs or FQDNs and the Kafka port (9092) to match your broker configuration.

If you set more than one Kafka node as `bootstrap.servers` the driver attempts to connect to the first entry.
If that is successful, the whole broker topology will be discovered and will be known by the client.
The other entries are used only if the connection to the first entry fails.

You can use any valid Kafka configuration property.
The following example uses SASL/SCRAM with TLS:

[source, karaf]
----
config:edit org.opennms.core.ipc.kafka
config:property-set bootstrap.servers my-kafka-ip-1:9096,my-kafka-ip-2:9096
config:property-set security.protocol SASL_SSL
config:property-set sasl.mechanism SCRAM-SHA-512
config:property-set sasl.jaas.config 'org.apache.kafka.common.security.scram.ScramLoginModule required username="opennms-ipc" password="kafka";'
config:update
----

NOTE: You can configure module-specific values for modules `sink`, `rpc`, and `twin` by replacing `org.opennms.core.ipc.kafka` in the `config:edit` command with `org.opennms.core.ipc.sink.kafka`, `org.opennms.core.ipc.rpc.kafka`, and `org.opennms.core.ipc.twin.kafka`, respectively.
      Module-specific configuration values take precedence over common configuration values.

Exit the Karaf shell with kbd:[Ctrl+d]

By default, the Minion will use a topic prefix of `OpenNMS`.
If you chose to use a different prefix in core (for example, to use a single Apache Kafka cluster with multiple {page-component-title} instances), change the topic prefix by setting the `org.opennms.instance.id` system property in `$MINION_HOME/etc/custom.system.properties`:
[source, properties]
----
org.opennms.instance.id=MyNMS<1>
----

<1> Change `MyNMS` to the prefix used by the {page-component-title} instance that this Minion should connect to.

.Restart the Minion to apply the configuration
[source,console]
----
sudo systemctl restart minion
----

.Verify the configuration using the health check in the Karaf shell
[source, console]
----
ssh -p 8201 admin@localhost
----

.Run the health check command
[source, karaf]
----
opennms:health-check
----

.Verify all components are configured properly
[source, output]
----
Verifying the health of the container

Echo RPC (passive)                       [ Success  ]
Verifying installed bundles              [ Success  ]
Connecting to Kafka from RPC             [ Success  ]
Connecting to Kafka from Sink Producer   [ Success  ]
Connecting to Kafka from Twin            [ Success  ]

=> Everything is awesome
----
