<p>I currently have Prometheus installed bare metal and running as docker containers. I use the same to monitor our infrastructure as well as Kubernetes clusters.</p>

<p>In order to make this set up HA, I was trying to deploy a proxy or a querier in front of the 2 Prometheus instances. And my first goal was to try Thanos. But I am not finding much documentation or information about bare-metal usage. The docs are all on Thanos implementation on Kubernetes.</p>

<p>Has anyone tried Thanos on bare metal?</p>

<p><strong>UPDATE:</strong></p>

<p>I used docker-compose to spin up sidecar and query components:</p>

<pre><code>thanos-sidecar:
  image: improbable/thanos:v0.5.0
  restart: always
  volumes:
    - tsdb-vol:/prometheus
  command: ['sidecar', '--tsdb.path="/prometheus"', '--prometheus.url=http://metrics_prometheus_1:9090' ]
  ports:
    - '10902:10902'
    - '10901:10901'
  depends_on:
  - Prometheus
  network:
    - thanos


thanos-querier:
  image: improbable/thanos:v0.5.0
  logging:
  # limit logs retained on host to 25MB
    driver: "json-file"
    options:
      max-size: "500k"
      max-file: "50"
  restart: always
  command: ['query' , '--http-address=0.0.0.0:19192' , '--query.replica-label=replica' , '--store=metrics_thanos-sidecar_1:10901', '--store=172.XX.XX.XXX:10901']
  ports:
    - '19192:19192'
  depends_on:
  - thanos-sidecar
  network:
    - thanos
</code></pre>

<p>I have exposed the store API,s gRPC ports at 10901 but the thanos-querier is still not able to reach them. Is there anything else that's missing on sidecar configs?</p>

swetad90
<p>It shouldn't be that much different from running in in Kubernetes.  The are K8s manifest files <a href="https://thanos.io/getting-started.md/" rel="nofollow noreferrer">here</a>, but you should be able to run each one of the components separately, either in a container or outside a containers.</p>

<p>For example, <a href="https://thanos.io/getting-started.md/#store-api" rel="nofollow noreferrer">Store API</a>:</p>

<pre><code>thanos sidecar \
    --tsdb.path                 /var/prometheus \
    --objstore.config-file      bucket_config.yaml \       # Bucket config file to send data to
    --prometheus.url            http://localhost:9090 \    # Location of the Prometheus HTTP server
    --http-address              0.0.0.0:19191 \            # HTTP endpoint for collecting metrics on the Sidecar
    --grpc-address              0.0.0.0:19090              # GRPC endpoint for StoreAPI
</code></pre>

<p>or <a href="https://thanos.io/getting-started.md/#query-gateway-components-query-md" rel="nofollow noreferrer">Query Gateway</a></p>

<pre><code>thanos query \
    --http-address 0.0.0.0:19192 \                                # HTTP Endpoint for Query UI
    --store        1.2.3.4:19090 \                                # Static gRPC Store API Address for the query node to query
    --store        1.2.3.5:19090 \                                # Also repeatable
    --store        dnssrv+_grpc._tcp.thanos-store.monitoring.svc  # Supports DNS A &amp; SRV records
</code></pre>

<p>or <a href="https://thanos.io/getting-started.md/#compactor-components-compact-md" rel="nofollow noreferrer">Compactor</a></p>

<pre><code>thanos compact \
    --data-dir             /var/thanos/compact \  # Temporary workspace for data processing
    --objstore.config-file bucket_config.yaml \   # Bucket where to apply the compacting
    --http-address         0.0.0.0:19191          # HTTP endpoint for collecting metrics on the Compactor)
</code></pre>

<p>or <a href="https://thanos.io/components/rule.md/" rel="nofollow noreferrer">Ruler</a></p>

<pre><code>thanos rule \
    --data-dir             "/path/to/data" \
    --eval-interval        "30s" \
    --rule-file            "/path/to/rules/*.rules.yaml" \
    --alert.query-url      "http://0.0.0.0:9090" \ # This tells what query URL to link to in UI.
    --alertmanagers.url    "alert.thanos.io" \
    --query                "query.example.org" \
    --query                "query2.example.org" \
    --objstore.config-file "bucket.yml" \
    --label                'monitor_cluster="cluster1"'
    --label                'replica="A"
</code></pre>

<p>Thanos is a <a href="https://golang.org/" rel="nofollow noreferrer">Go</a> binary so it can run on most systems that Go supports as a <a href="https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63" rel="nofollow noreferrer">target</a>.</p>
