Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Run System

Hessam Shahriari edited this page Feb 13, 2020 · 1 revision

In order to run all logging and metric apps, on an environment with Hashicorp stack installed, complete the followings:

Logging:

  1. Login to Azure Portal, create a new resource group, create a Log Analytics workspace under this new resource group, and then attached a Container Monitoring solution to it.
  2. Once he workspace is created, navigate to the workspace, and click on Advanced setting, and copy both Workspace ID and Primary Key:
Screen Shot 2020-02-13 at 12 51 30 PM
  1. Login to Vault, and write down the wsid, and key as follow:
$ vault write secret/azure/logs/wsid value=XXXXX
$ vault write secret/azure/logs/key value=XXXX

NOTE: In new version of Vault you have to use KV engine.

  1. Clone this repo, and write the policy file located at azure-log.hcl/azure-log-policy.hcl:
$ vault policy write azure-log azure-log-policy.hcl
  1. Run OMS containers that collect and ship data buy running the nomad job located at azure-log.hcl/azure-log.hcl:
$ nomad plan azure-log.hcl
$ nomad run azure.log.hcl

Metrics:

  1. For metrics, we need to deploy Prometheus server, Pushgateway server, CAdvisor, Node Exporter and Grafana dashboard by running the nomad files under prometheus directory of this repo:
$ nomad run prometheus.hcl
$ nomad run node-info.hcl
$ nomad run grafana.hcl
  1. Now check the HAproxy configuration template on HAProxy server and make sure it does support monitoring tag withing the consul-template. If not, replace the content of HAProxy template file with prometheus\haproxy.config.tpl and then restart consul-template service to load the new config:
$ sudo systemctl restart consul-template

Note: This takes 1-2min Now check the HAProxy config file to make sure monitoring end points are set:

$ cat /etc/haproxy/haproxy.cfg
  1. Import Garfana dashboard's located in grafana_dashboard directory within this repo.
Clone this wiki locally