-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Raman Sailopal edited this page Jul 12, 2021
·
13 revisions
- Install Grafana - https://grafana.com/docs/grafana/latest/installation/
- Install Prometheus - https://prometheus.io/docs/prometheus/latest/installation/
- Run the YottaDB metrics “exporter” by following the instructions here https://github.com/RamSailopal/yotta-dashboard/blob/main/README.md
- Add the extract found at https://raw.githubusercontent.com/RamSailopal/yotta-dashboard/main/prometheus.yml to the prometheus.yml config file in /etc/prometheus. Change the IP address and port to the address/port of the server where the “exporter” is running accordingly.
- Start Prometheus
- Start Grafana and log into the web interface (default port is 3000, default username and password is admin/admin)
- Click on the cog icon on the left hand side representing configuration, then Data Sources and Add Data Source. Select the Prometheus data source. Name it and then enter the URL. Click Save and Test to ensure it is working.
- Click on the four square boxes icon on the left hand side representing Dashboards. Click Manage and then Import. Paste the JSON found here - https://raw.githubusercontent.com/RamSailopal/yotta-dashboard/main/examples/Yottadb-grafana.json to the json panel. Click Load.
- A dashboard will then be created showing Orders, Sets and Gets metrics. To add further metrics, click on the add panel icon, then click the Metrics “drop down” option in the Query section, ensuring that Prometheus is selected as the data source. All the metrics exported from YottaDB should now appear for selection to chart in a panel.
- Attain the latest copy of Loki - e.g. curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.1/loki-linux-amd64.zip
- Unzip the file to attain the executable - unzip "loki-linux-amd64.zip"
- Give the executable file executable permissions - chmod a+x "loki-linux-amd64"
- Move the executable file to an executable system path and rename to loki - mv "loki-linux-amd64" "/usr/local/bin/loki"
- Create a configuration directory for Loki - mkdir "/etc/Loki"
- Copy the configuration yaml file cp "loki.yaml" "/etc/loki"
- Amend the configuration file with the correct IP address accordingly
- Create a systemd service file - cp "systemd/loki.service" "/usr/lib/systemd/system/loki.service"
- Attain the latest copy of Promtail - e.g. curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.1/promtail-linux-arm64.zip"
- Unzip the file to attain the executable - unzip "promtail-linux-amd64.zip"
- Give the executable file executable permissions - chmod a+x "promtail-linux-amd64"
- Move the executable file to an executable system path and rename to loki - mv "promtail-linux-amd64" "/usr/local/bin/promtail"
- Create a configuration directory for Loki - mkdir "/etc/promtail"
- Copy the configuration yaml file cp "promtail.yaml" "/etc/promtail"
- Create a systemd service file - cp "systemd/promtail.service" "/usr/lib/systemd/system/promtail.service"
- Reload the systemd daemon - systemctl daemon-reload
- Start the Loki service - systemctl start loki
- Start the Promtail service - systemctl start promtail
- Add the JSON from https://raw.githubusercontent.com/RamSailopal/YottaDB-dashboard/main/examples/Yottadb-graf-loki.yaml to create a new dashboard (as instructed earlier)
- Add the promtail-mgsi.yaml contents to /etc/promtail/promtail.yaml - cat promtail-mgsi.yaml >> /etc/promtail/promtail.yaml
- Restart the Promtail service - systemctl restart promtail
- Run install-mgsi.sh to install and run the %zmgsi("log") global export daemon - ./install.mgsi.sh
- Add a new panel to the dashboard with Loki as the Query source and the label as filename=/var/log/mgsi.log
- Install the infinity Grafana datasource by accessing the command line of the server running Grafana and executing grafana-cli plugins install yesoreyeram-infinity-datasource
- On the Grafana GUI, access datasources in the same way as previously covered and add an infinity datasource
- Enter the URL of the endpoint as e.g. http://<< ipaddress of api server >>:<< port of api server >>/routines
- Click Save and Test
- Repeat the process of adding additional Infinity datasources for each for of the endpoints i.e. /globals, /locks etc.
- Import the dashboard https://raw.githubusercontent.com/RamSailopal/YottaDB-dashboard/main/apiserver/apidash.json in the same way as previously covered
- A second dashboard should now be available with the name - YottaDB1