Big Data 219 - Grafana Installation & Startup

Basic Introduction

Grafana is a powerful open-source visualization and monitoring platform, created by Torkel Ödegaard in 2014. Written in Go, with frontend built on React framework, supports cross-platform deployment.

Main Application Scenarios

  1. IT Infrastructure Monitoring: Real-time display of server CPU, memory, disk and other resource usage
  2. Application Performance Monitoring (APM): Track application response times, error rates, and other key metrics
  3. Business Data Analysis: Visualize sales data, user behavior, and other business metrics
  4. IoT Monitoring: Display temperature, humidity, and other environmental data from sensors

Core Features

Data Source Support

Grafana supports multiple data sources including Prometheus, Graphite, Elasticsearch, MySQL, PostgreSQL, InfluxDB, and more. Users can combine data from different data sources in one dashboard.

Flexible Visualization

Grafana provides various visualization options: line charts, bar charts, scatter plots, pie charts, gauges, and more. It also supports setting data query time ranges, dynamic refresh, and multiple filters.

Custom Alerting

Grafana supports creating condition-based alerts (alert), which can automatically send notifications when metrics reach preset thresholds. Alert notifications support multiple channels including email, Slack, Microsoft Teams, and more.

Users and Access Control

Grafana supports user grouping and permission management, allowing different dashboards access permissions for different users or teams.

Installation Download

yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-11.3.0-1.x86_64.rpm

Start Service

sudo systemctl start grafana-server
sudo systemctl status grafana-server

Access Service

http://h121.wzk.icu:3000/login

Requires username and password. After initialization, default username and password are both admin.

Project Advantages

Cross-Data-Source Unified Monitoring

Grafana provides powerful data integration capabilities, supporting seamless integration of 50+ data sources including Prometheus, InfluxDB, Elasticsearch, MySQL, PostgreSQL, and more.

Active Community, Rich Plugins

Grafana has a community ecosystem of over 1 million active users. Main advantages include:

  • Official plugin marketplace offers 200+ officially certified plugins
  • Thousands of dashboard templates contributed by the community

Real-time and High Performance

  • Supports processing 100,000+ data points per second
  • Query response time <100ms (with reasonable hardware configuration)

Deep Integration with Other Monitoring Tools

Prometheus Integration

Prometheus is a powerful time-series data monitoring system. Through deep integration with Prometheus:

  • Real-time data fetching
  • Flexible query language PromQL
  • Alert integration

Loki Integration

Loki is a log aggregation system developed by Grafana Labs, seamlessly integrated with Grafana:

  • Unified visualization interface
  • Efficient log search
  • Correlation analysis capabilities

Jaeger Integration

Jaeger is an open-source distributed tracing system from Uber, combined with Grafana provides:

  • Complete request chain visualization
  • Performance bottleneck analysis
  • Correlation with metrics and logs

Common Configuration

Configure Data Source

  1. Click “Configuration” → “Data Sources”
  2. Click “Add data source”
  3. Select Prometheus
  4. Enter URL: http://prometheus:9090
  5. Click “Save & Test”

Create Dashboard

  1. Click ”+” → “Dashboard”
  2. Click “Add new panel”
  3. Enter PromQL query in metric browser
  4. Adjust visualization type
  5. Save dashboard

Error Quick Reference

SymptomRoot CauseFix
systemctl start grafana-server failedMissing dependencies/config file syntax error/port conflictsystemctl status grafana-server -l
Service shows running, but browser can’t open :3000Firewall/security group not openedss -lntp | grep 3000
Localhost curl works, external domain doesn’tReverse proxy/domain resolution/port mapping issueCheck Nginx/SLB config and DNS resolution
Login page opens but always 302/redirect looproot_url/serve_from_sub_path config doesn’t match reverse proxy pathBrowser Network check 302 Location
Login admin shows failedInitial password changed/local login disabledCheck Grafana logs
Slow/dashboard loading stuckData source query slow/high concurrencyGrafana Explore/Query Inspector
Plugin install fails/panel missingPlugin signature/version mismatchGrafana logs