Deploy and bootstrap using Docker

Grafana Metrics Enterprise DocumentationGetting StartedDeploy / Docker

Create network

To allow our deployed containers to interact with each other, we create a dedicated network first:

$ docker network create metrics-enterprise

Initialize bucket storage

During this guide we assume that the object storage also runs in our local Docker. We use MinIO to provide us with the necessary object store implementation:

$ # Create persistent storage
$ docker volume create minio-data

$ # Run the minio object store daemon
$ docker run -d \
   --name minio \
   --network=metrics-enterprise \
   -e "MINIO_ACCESS_KEY=metrics-enterprise" \
   -e "MINIO_SECRET_KEY=supersecret" \
   -v minio-data:/data \
   minio/minio server /data

$ # Create buckets
$ docker exec minio mkdir -p /data/metrics-enterprise-admin /data/metrics-enterprise-ruler /data/metrics-enterprise-tsdb

Bootstrap the cluster

Now is the time to bootstrap the cluster:

$ docker run \
   --rm \
   --name metrics-enterprise-bootstrap \
   --network=metrics-enterprise \
   -v $(pwd)/metrics-enterprise.yaml:/etc/metrics-enterprise/metrics-enterprise.yaml:z \
   -v $(pwd)/license.jwt:/etc/metrics-enterprise/license.jwt:z \
   grafana/metrics-enterprise:v1.0.2 \
   -config.file=/etc/metrics-enterprise/metrics-enterprise.yaml \
   -bootstrap.license.path=/etc/metrics-enterprise/license.jwt \
   -log.level=warn \
   -target=bootstrap
Token created:  YWRtaW4tcG9saWN5LWJvb3RzdHJhcC10b2tlbjo8Ujc1IzQyfXBfMjd7fDIwMDRdYVxgeXw=

Option A: Run single replica of Metrics Enterprise

With the following command we can deploy a single replica deployment of Metrics Enterprise:

$ docker run \
   -d \
   --name metrics-enterprise-1 \
   --network=metrics-enterprise \
   --network-alias=metrics-enterprise \
   -v $(pwd)/metrics-enterprise.yaml:/etc/metrics-enterprise/metrics-enterprise.yaml:z \
   -v $(pwd)/license.jwt:/etc/metrics-enterprise/license.jwt:z \
   grafana/metrics-enterprise:v1.0.2 \
   -config.file=/etc/metrics-enterprise/metrics-enterprise.yaml \
   -log.level=warn \
   -memberlist.join=metrics-enterprise:7946 \
   -querier.frontend-address=metrics-enterprise:9095 \
   -distributor.replication-factor=1

Option B: Run three replicas of Metrics Enterprise

With the following command we can deploy a multi replica deployment of Metrics Enterprise:

$ # Create a metrics-enterprise container with 3 replicas
$ for i in {1..3}; do docker run \
   -d \
   --name metrics-enterprise-${i} \
   --network=metrics-enterprise \
   --network-alias=metrics-enterprise \
   -v $(pwd)/metrics-enterprise.yaml:/etc/metrics-enterprise/metrics-enterprise.yaml:z \
   -v $(pwd)/license.jwt:/etc/metrics-enterprise/license.jwt:z \
   grafana/metrics-enterprise:v1.0.2 \
   -config.file=/etc/metrics-enterprise/metrics-enterprise.yaml \
   -log.level=warn \
   -memberlist.join=metrics-enterprise:7946 \
   -querier.frontend-address=metrics-enterprise:9095
  done

Setup Metrics Enterprise in Grafana

The next step is to integrate our Metrics Enterprise backend with Grafana. This will give us a UI to interact with the Admin API.