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¶
Clone the repository:
git clone https://github.com/containerscrew/nflux.git
Adjust system settings (Linux):
sudo sysctl -w vm.max_map_count=262144
Navigate to the infrastructure directory:
cd nflux/infra
Copy the environment file:
cp .env.example .env
Generate a password for the OpenSearch admin user:
You must generate a secure password for the OpenSearch administrator user.
pwgen -s -y 16 1
Edit the .env file:
Use the password generated in the previous step to update the relevant fields in the .env file.
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
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.
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-*
Create the index pattern in OpenSearch Dashboards:
Visit the official Opensearch documentation to create an index pattern: Creating index patterns.