
Mimir is an open-source, horizontally scalable time-series database designed for long-term storage of Prometheus metrics. Developed by Grafana Labs, it provides high availability, multi-tenancy, and seamless integration with Prometheus and Grafana. Mimir enables organizations to store and query billions of active time series while maintaining fast query performance across months or years of historical data.
In this article, you will deploy Mimir using Docker Compose, configure persistent storage for metrics data, and set up Traefik as a reverse proxy to securely access your Mimir instance.
Before you begin, you need to:
sudo privileges.mimir.example.com).In this section, you prepare the required directory structure for Mimir and define environment variables in a .env file.
Create the directory structure for Mimir.
These directories store time-series blocks, WAL files, and configuration settings.
Navigate into the mimir-metrics directory.
Create a .env file.
Add the following variables:
Replace:
mimir.example.com with your domain.admin@example.com with your email.Save and close the file.
Create a Mimir configuration file.
Add the following content.
Save and close the file.
This configuration establishes single-node operation with filesystem storage. The memberlist key-value store handles internal coordination, while blocks_storage manages the time-series database with local persistence. Setting limits to 0 removes ingestion restrictions for development deployments.
In this section, you create and deploy the Docker Compose stack that runs Mimir behind Traefik. Docker Compose manages both containers, applies the environment variables from your .env file, and automatically configures HTTPS routing through Traefik.
Create a new Docker Compose manifest.
Add the following content.
Save and close the file.
This deployment manifest includes:
letsencrypt named volume maintains certificate persistence across service restarts.Create and start the services.
Verify that the services are running.
Output:
Both containers are running. Mimir accepts metrics while Traefik handles connections on ports 80 and 443.
View the logs of the services.
For more information on managing a Docker Compose stack, see the How To Use Docker Compose article.
This section demonstrates accessing the Mimir API to verify your installation by checking service health and querying the Prometheus-compatible endpoints.
Check the service readiness endpoint.
Output:
This confirms Mimir has initialized successfully and is accepting requests.
Verify Mimir build information.
Output displays version details, confirming the API is responding correctly.
Query the current configuration.
Output returns the active configuration in YAML format, confirming Mimir loaded your settings properly.
Check ingester ring status.
Output displays the internal ring status showing this node as active and ready to receive metrics.
You have successfully deployed Mimir for long-term metrics storage with HTTPS encryption. The Docker Compose architecture pairs the time-series database with automated SSL certificate management, while persistent volumes maintain your metrics data through container updates and restarts. Traefik handles secure traffic routing and certificate renewal seamlessly. Your Mimir instance is ready to receive metrics from Prometheus instances via remote write, store historical data efficiently, and serve PromQL queries for visualization in Grafana dashboards.
0 Comments
Be the first to comment and share your perspective with the community.