# Distributed Install

This installation guide describes a distributed install where we run ALEC as a service on top of the Sentinel runtime:

## Prequisites

In addition to an existing instance of OpenNMS Horizon 24.0.0 or greater, this guide assumes you have:

1. A Kafka broker (or cluster) running Kafka 0.11.x or greater.

2. One or more Minions are already active in the system

• The Minions are configured to use Kafka for the transport

• The Minions are ready to receive SNMP traps and Syslog messages

## Common Setup

Start by following the instructions in the common install section if you have not already done so.

When installing the package repository, ensure that this is done on all of the systems that are running Sentinel and/or OpenNMS.

## OpenNMS Configuration

### Enable and configure the Kafka Producer (for topology & alarms)

Configure the Kafka Producer to point to your Kafka broker:

``echo 'bootstrap.servers=127.0.0.1:9092' > "$OPENNMS_HOME/etc/org.opennms.features.kafka.producer.client.cfg"`` Disable incremental alarm suppression: ``echo 'suppressIncrementalAlarms=false' >> "$OPENNMS_HOME/etc/org.opennms.features.kafka.producer.cfg"``

Add `opennms-kafka-producer` to the `featuresBoot` property in the `$OPENNMS_HOME/etc/org.apache.karaf.features.cfg`. ### Enable consumption of events from Kafka Enable the Sink API consumer for Eventd: ``echo 'org.opennms.netmgt.eventd.sink.enable=true' > "$OPENNMS_HOME/etc/opennms.properties.d/event-sink.properties"``
 We assume that you’re already using the Kafka strategy for the Sink API. See Prequisites.

## Install ALEC in OpenNMS

On the OpenNMS server, install the package:

``yum -y install opennms-alec-plugin``

Configure the feature set to be installed when OpenNMS starts:

``echo 'alec-opennms-distributed wait-for-kar=opennms-alec-plugin' > "$OPENNMS_HOME/etc/featuresBoot.d/alec.boot"`` ## Install ALEC in Sentinel On the Sentinel systems, install the package: ``yum -y install sentinel-alec-plugin`` Configure the Kafka Stream (consumer): ``````echo 'bootstrap.servers=127.0.0.1:9092 commit.interval.ms=5000' > "$SENTINEL_HOME/etc/org.opennms.alec.datasource.opennms.kafka.streams.cfg"``````

Configure the Kafka producer:

``echo 'bootstrap.servers=127.0.0.1:9092' > "$SENTINEL_HOME/etc/org.opennms.alec.datasource.opennms.kafka.producer.cfg"``  The consumer is used to read alarms & inventory, whereas the producer is used to send events. Configure ZooKeeper for distributed coordination: ``echo 'connectString=127.0.0.1:2181' > "$SENTINEL_HOME/etc/org.opennms.features.distributed.coordination.zookeeper.cfg"``

Configure the feature set to be installed when Sentinel starts:

``````echo 'sentinel-core
sentinel-coordination-zookeeper
alec-sentinel-distributed wait-for-kar=opennms-alec-plugin' >> "\$SENTINEL_HOME/etc/featuresBoot.d/alec.boot"``````

## Verify

Restart OpenNMS and Sentinel.

Ensure that the required Kafka topics are created. See topics for details.

Run the `health:check` commands in both OpenNMS and Sentinel.

From a Sentinel Karaf shell, enumerate the available graphs using:

``opennms-alec:list-graphs``

At this point we expect the command output a single graph called "dbscan":

``````admin@opennms> opennms-alec:list-graphs
dbscan: 0 situations on 524 vertices and 4 edges.``````

It’s okay if there are no situations, vertices or edges on the graph at this point.

Continue to Verifying your install for more details.