Grafana Mimir is a powerful open-source time-series database designed to handle large-scale metrics workloads. It is part of the Grafana ecosystem and is known for its scalability and performance. Deploying Grafana Mimir as a monolith service can simplify the setup process, especially for smaller environments or testing purposes. In this article, we’ll walk through deploying Grafana Mimir using Docker Compose, which allows for easy management and orchestration of containerized applications.
Prerequisites
Before you begin, ensure you have the following installed on your system:
- Docker: Install Docker
- Docker Compose: Install Docker Compose
Docker Compose Configuration
To deploy Grafana Mimir as a monolith service, we’ll use Docker Compose to define and run a multi-container Docker application. Below is a sample docker-compose.yml
file that sets up Grafana Mimir:
version: '3.8'
services:
mimir:
image: grafana/mimir:latest
container_name: grafana-mimir
ports:
- "9009:9009" # Mimir API
- "9095:9095" # Mimir Query Frontend
environment:
- MIMIR_MODE=all
- MIMIR_LOG_LEVEL=info
- MIMIR_STORAGE_BACKEND=filesystem
- MIMIR_STORAGE_PATH=/data/mimir
volumes:
- mimir-data:/data/mimir
restart: unless-stopped
volumes:
mimir-data:
Explanation of the Configuration
- Image: We use the
grafana/mimir:latest
image to ensure we have the latest version of Grafana Mimir. - Ports: The service exposes ports
9009
for the Mimir API and9095
for the query frontend. These ports can be adjusted as needed. - Environment Variables:
MIMIR_MODE=all
: This sets Mimir to run in monolith mode, where all components are bundled into a single service.MIMIR_LOG_LEVEL=info
: Sets the logging level toinfo
for better visibility into the service’s operations.MIMIR_STORAGE_BACKEND=filesystem
: Configures Mimir to use the filesystem for storage, suitable for local testing.MIMIR_STORAGE_PATH=/data/mimir
: Specifies the path where Mimir will store its data.
- Volumes: A named volume
mimir-data
is used to persist data across container restarts.
Deploying Grafana Mimir
With the docker-compose.yml
file in place, you can deploy Grafana Mimir by running the following command in the directory containing your docker-compose.yml
file:
docker-compose up -d
This command will start the Grafana Mimir service in detached mode. You can check the status of the service using:
docker-compose ps
To view logs for the Mimir service, use:
docker-compose logs -f mimir
Accessing Grafana Mimir
Once the service is running, you can access the Mimir API at http://localhost:9009
and the query frontend at http://localhost:9095
. These endpoints can be integrated with Grafana for visualization and further analysis.
Conclusion
Deploying Grafana Mimir as a monolith service using Docker Compose is a straightforward process that provides a quick way to get started with this powerful time-series database. This setup is ideal for development and testing environments. For production deployments, consider a more distributed architecture to leverage Mimir’s full scalability and resilience capabilities.
References
By following this guide, you should be able to deploy and manage Grafana Mimir effectively, gaining insights into your metrics with ease.