Monitoring

The stack used to visualize the logs generated by nflux is OpenSearch. To set up your own logging stack, follow the steps below:

Setting up the OpenSearch Stack

  1. Clone the repository:

git clone https://github.com/containerscrew/nflux.git
  1. Adjust system settings (Linux):

sudo sysctl -w vm.max_map_count=262144
  1. Navigate to the infrastructure directory:

cd nflux/infra
  1. Copy the environment file:

cp .env.example .env
  1. Generate a password for the OpenSearch admin user:

You must generate a secure password for the OpenSearch administrator user.

pwgen -s -y 16 1
  1. Edit the .env file:

Use the password generated in the previous step to update the relevant fields in the .env file.

  1. Download the required geoip database:

You need to download the GeoLite2 City database from MaxMind to enable geolocation features in Fluent Bit.

wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -O ./geoip/GeoLite2-City.mmdb
  1. Start the stack:

Use the appropriate command depending on your container engine (Podman or Docker).

podman-compose -f monitoring.yml up -d

Alternatively, use `docker-compose -f monitoring.yml up -d` if you are using Docker.

  1. Open the dev tools in OpenSearch Dashboards and run the following command to create an index template mapping:

PUT _index_template/node-geo-template
 {
   "index_patterns": ["nflux*"],
   "template": {
     "mappings": {
       "properties": {
         "location": { "type": "geo_point" }
       }
     }
   }
 }

 GET nflux-*/_mapping

 DELETE nflux-*
  1. Create the index pattern in OpenSearch Dashboards: