Deploy on bare metal

Grafana Metrics Enterprise DocumentationGetting StartedDeploy / Bare Metal

Prerequisites

  • Before deploying the nodes, ensure that the object store is configured correctly, and all buckets are created.
  • For the GME query scheduler to work correctly, we recommend that you configure a DNS name that resolves to all nodes of the Metrics Enterprise cluster. This guide uses metrics-enterprise.local in the following examples.
  • A replication factor that matches the number of nodes you will deploy to. In case you are planning to deploy a cluster on less than three nodes, reduce the replication_factor value in your configuration file to 1.

Install Metrics Enterprise

To install Grafana Metrics Enterprise we run those steps on every node:

$ # Add dedicated user and group
$ groupadd --system metrics-enterprise
$ useradd --system --home-dir /var/lib/metrics-enterprise -g metrics-enterprise metrics-enterprise

$ # Create directories
$ mkdir -p /etc/metrics-enterprise /var/lib/metrics-enterprise
$ chown root:metrics-enterprise /etc/metrics-enterprise
$ chown metrics-enterprise:metrics-enterprise /var/lib/metrics-enterprise
$ chmod 0750 /etc/metrics-enterprise /var/lib/metrics-enterprise

$ # Download metrics enterprise binary
$ curl -Lo /usr/local/bin/metrics-enterprise https://storage.googleapis.com/grafana-metrics-enterprise/releases/metrics-enterprise-v1.0.2-linux-amd64
$ echo "dceda7c43bcde4b76c5aab9cd9da1db7aa01df5f99dec2bdfcceaf49ecafb708  /usr/local/bin/metrics-enterprise" | sha256sum -c
$ chmod 0755 /usr/local/bin/metrics-enterprise
$ setcap 'cap_net_bind_service=+ep' /usr/local/bin/metrics-enterprise

$ # Setup systemd unit and enable startup on boot
$ cat > /etc/systemd/system/metrics-enterprise.service <<EOF
[Unit]
After=network.target

[Service]
User=metrics-enterprise
Group=metrics-enterprise
WorkingDirectory=/var/lib/metrics-enterprise
ExecStart=/usr/local/bin/metrics-enterprise \
   -config.file=/etc/metrics-enterprise/metrics-enterprise.yaml \
   -log.level=warn \
   -memberlist.join=metrics-enterprise.local:7946 \
   -querier.frontend-address=metrics-enterprise.local:9095

[Install]
WantedBy=default.target
EOF
$ systemctl enable metrics-enterprise.service

Copy configuration and license

Now we need to copy the configuration and the license files to all nodes in the Metrics Enterprise cluster:

  • metrics-enterprise.yaml should be copied to /etc/metrics-enterprise/metrics-enterprise.yaml
  • license.jwt should be copied to /etc/metrics-enterprise/license.jwt

Bootstrap on a single node

On a single node in the cluster we need to bootstrap Metrics Enterprise. This can be achieved by running:

$ su metrics-enterprise -c "/usr/local/bin/metrics-enterprise \
   -config.file=/etc/metrics-enterprise/metrics-enterprise.yaml \
   -bootstrap.license.path=/etc/metrics-enterprise/license.jwt \
   -log.level=warn \
   -target=bootstrap"
Token created:  YWRtaW4tcG9saWN5LWJvb3RzdHJhcC10b2tlbjo8Ujc1IzQyfXBfMjd7fDIwMDRdYVxgeXw=

Start all Metrics Enterprise replicas

Following the bootstrap we can now start Metrics Enterprise on all nodes:

$ systemctl start metrics-enterprise.service

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.