What is Grafana HA (High Availability)?
Grafana HA is a multi-server architecture that enables Grafana to run uninterruptedly, continuously and reliably. When one server goes down, the others take over so users don’t experience interruptions.
Why is it needed?

  • If you use Grafana in critical business applications, 24/7 access is a must
  • You want no service interruption when a single server fails
  • If you want to distribute the load across multiple servers to increase performance when the load increases

Kullanılan Araçlar

Grafana

Dashboard ve veri görselleştirme

PostgreSQL

Grafana’nın dashboard, kullanıcı ve ayar verilerini saklar (merkezi DB)

Nginx / HAProxy

Trafiği birden fazla Grafana sunucusuna dengeler (Load Balancer / Reverse Proxy)

Kurulum Adımları

  1. Nginx Kurulumu
brew install nginx
vi /opt/homebrew/etc/nginx/nginx.conf

upstream grafana_backend {
    server 127.0.0.1:3001;  # 1. Grafana sunucusu
    server 127.0.0.1:3002;  # 2. Grafana sunucusu
}

server {
    listen 80;
    server_name grafana.local;

    location / {
        proxy_pass http://grafana_backend;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}


brew services start nginx
brew services list

Grafana Install

brew install grafana

Postgresql connection stringlerini yazıyoruz grafana configine
öncesinden verilen /grafana ile ilgili database oluşturulması gerekiyor

vi /System/Volumes/Data/opt/homebrew/etc/grafana/grafana.ini

# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
url = postgres://ibrahimyildiz:nubes_2020@127.0.0.1:5432/grafana

brew services start grafana

Adding DNS to /etc/hosts file


sudo nano /etc/hosts

127.0.0.1 grafana.local

When we go to https://grafana.local, we will see that it has added Grafana and you will see that it has registered with the Postgresql database.

Yes, we see the records coming.

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir