Installation using Docker

A Docker container for NetObserv Flow is available on Docker Hubarrow-up-right. docker-composearrow-up-right is a good way to run the container. It allows for the various environment variables, used to configure the collector, to be easily managed in one place without having to enter them on the command line.

docker-compose.yml

The following docker-compose.yml file provides an example with common settings that will likely need to be configured to process flow records and send them to Elasticsearch.

image

The name of the current released image is elastiflow/flow-collector:7.24.0.

restart

restart is set to unless-stopped so that the collector will restart automatically if it fails for some reason.

network_mode

There is a old issue with Docker that persists still, where an inbound packet's source IP address is not persisted across the Docker bridge interface. This is not an issue for sFlow as the exporter's IP is extracted from the agent_address in the sFlow header. However for Netflow and IPFIX the source IP from the IP header is all that is available to determine which device sent the records. The Docker bridge messes this up.

To work around this issue network_mode must be set to host.

circle-info

On macOS Docker containers do not run natively on the operating system. They actually run in a behind the scenes linux VM. In the case `host` networking would be the network stack of the VM and not of macOS itself. This means the `bridged` mode networking must be used and the necessary port mapping defined. Because of the source IP issues mentioned above, you will not be able to do much on macOS other than basic testing.

volumes

There are a few scenarios where it is necessary to make files on the host file system available to the collector.

In the example above, /etc/elastiflow on the host's filesystem is mapped into the same path within the container. After downloading the GeoLite2-City and GeoLite2-ASN maxmind databases from the Maxmind website, they can be placed at /etc/elastiflow/maxmind on the host's filesystem and will be able to be accessed by the collector within the container.

The /var/lib/elastiflow/flowcoll path is used by the container to persist data across container restarts. This is a new requirement for version 7.5 and later. The path on the host system must be created and have the correct permissions set. The path can be changed to any desired location on the host system.

circle-info

It is also possible to build a new container, adding additional files as needed. This may the best choice if running the container in a dynamically orchestrated environment (e.g. running in Kubernetes). However for an instance dedicated to a specific host, using bind mounted volumes can be very convenient.

environment variables

NetObserv Flow is configured using environment variables. The settings above provide an example configuration that represents the most likely settings to consider and modify when deploying the collector.

For a complete reference of all configuration options please refer to the Configuration Reference.

Running the Container

After completing configuration of the collector in the docker-compose.yml file, you can start the container using one of the following commands...

From within the same path as the docker-compose.yml file:

From a path different from the location of the docker-compose.yml file:

To view the logs written by the container run:

To stop the container run:

or:

Last updated

Was this helpful?