Link Search Menu Expand Document

Prometheus and m3db in docker in 5min

Preconditions

  • Docker installed and active

Quick Setup

Download stuff
docker pull quay.io/m3/m3dbnode:latest
wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz
tar zxvf prometheus-2.6.0.linux-amd64.tar.gz
Start M3DB
mkdir m3db_data
docker run -p 7201:7201 -p 9003:9003 --name m3db -v $(pwd)/m3db_data:/var/lib/m3db quay.io/m3/m3dbnode:latest
Configure and Start Prometheus
cd prometheus-2.6.0

# Add m3coordinator as read/write backend
cat <<EOT
remote_read:
  - url: "http://localhost:7201/api/v1/prom/remote/read"
    # To test reading even when local Prometheus has the data
    read_recent: true
remote_write:
  - url: "http://localhost:7201/api/v1/prom/remote/write"
EOT >>prometheus.yml

./prometheus --config.file="prometheus.yml

Test

Verify M3DB is running by accessing http://localhost:7201/api/v1/openapi. Check that Prometheus is running and returning its self-monitoring metrics http://localhost:9090/graph?g0.range_input=1d&g0.expr=go_memstats_alloc_bytes&g0.tab=0