#DAY17 of #60DaysDevOps Challenge |Grafana
Youtube Live Link = https://www.youtube.com/live/3ksgSScVnUM?si=jZdrwOFMPL02X3r-
2nd Part Live = https://www.youtube.com/live/E9tKb7d9NGw?si=82Z5lmW9TLXj38BB
Install Grafana on Debian or Ubuntu
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
Stable release
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Beta release
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
# Update the list of available packages
sudo apt-get update
# Install the latest OSS release:
sudo apt-get install grafana
#To start Grafana Server
sudo /bin/systemctl status grafana-server
Install Loki and Promtail using Docker
Download Loki Config
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run -d --name loki \
-v /home/ubuntu/loki-config.yaml:/mnt/config/loki-config.yaml \
-p 3100:3100 \
grafana/loki:2.8.0 \
--config.file=/mnt/config/loki-config.yaml
Download Promtail
Download Promtail Config
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
Run Promtail Docker container
docker run -d --name promtail -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.0 --config.file=/mnt/config/promtail-config.yaml