Install and Secure Grafana on Ubuntu 20.04

Install and Secure Grafana on Ubuntu 20.04

1. Introduction To Grafana

  • Grafana is an open-source platform for data visualization, monitoring and analysis.
  • It is most commonly used for visualizing time series data for infrastructure and application analytics.
  • In my company, we use it with primarily Elastic search and InfluxDB, though Grafana also supports other data sources Prometheus, MySQL, etc.
  • for each data source, Grafana has a customization query editor and specific syntax.

2. Features Of Grafana

  • open-source : it's completely open source, and can be easily install on any platform.
  • Visualization : Grafana has a plethora of Visualization options to help you understand your data, beautifully.
  • Alerting : Seamlessly define alerts (smoothly and continuously) where it makes sense - while you're in the data. Define threshold visually, get notified via Slack, Pager Duty, and more
  • Unifying : Bring Your data together to get better context. Grafana supports dozens of databases, natively.
  • Extended Plugins : Discover hundreds of dashboards and plug-in in the official library.
  • Collaboration : Bring everyone together, and share data and dashboards across teams.

3. Environment file of Grafana

  • The systemd service file and init.d script both use the file located at /etc/sysconfig/Grafana-server
  • By default Grafana will log to (i.e. login log ill be found) at /var/log/grafana
  • The default configuration of database located at /var/lib/grafana/grafana.db
  • The configuration file is located at /etc/grafana/grafana.ini

installation of Grafana On Linux(Ubuntu)

  1. Configuring user for Xplot?in Grafana.

sudo apt-get install -y adduser libfontconfig1        

2. Download Grafana package version 9.4.7

wget https://dl.grafana.com/enterprise/release/grafana-enterprise_9.4.7_amd64.deb?        

3. Grafana repository to your APT sources

sudo dpkg -i grafana-enterprise_9.4.7_amd64.deb        

4. To install Grafana OSS, run the following command

sudo apt-get install grafana        

5. Start and enable the Grafana-server?

systemctl enable --now grafana-server
systemctl restart grafana-server?        

6. Login into the Grafana By URL on Port 3000

https://project.shubhamgupta.online:3000        
No alt text provided for this image

7. if we want to secure the Grafana server then i have to implement SSL

wget https://shubhamgupta.com/project.shubhamgupta.online.zip
unzip project.shubhamgupta.online.zip        
No alt text provided for this image

8. move the ca certificate, private key, bundle key in /etc/grafana .

mv ca_bundle.crt /etc/grafana/shubham_bundle.crt
mv certificate.crt /etc/grafana/shubham.crt
mv ptivate.key /etc/grafana/shubham.key
chown grafana:grafana /etc/grafana/shubham.crt
chown 600 /etc/grafana/shubham.crt
chown grafana:grafana /etc/grafana/shubham_bundle.crt
chown 644 /etc/grafana/shubham_bundle.crt
chown grafana:grafana /etc/grafana/shubham.key
chown 600 /etc/grafana/shubham.key        
No alt text provided for this image

9. some change in Grafana configuration for ssl

vim /etc/grafana/grafana.ini
[server]
http_addr = 
http_port = 3000
domain = shubhamgupta.online
root_url = https://project.shubhamgupta.online:3000
cert_key = /etc/grafana/shubham.key
cert_file = /etc/grafana/shubham.crt
enforce_domain = false
protocol = https        
No alt text provided for this image

10. allow the 3000 port in firewall

ufw allow 3000/tcp
systemctl restart grafana-server        
No alt text provided for this image

10. Login into the Grafana By URL on Port 3000

https://project.shubhamgupta.online:3000        
No alt text provided for this image
No alt text provided for this image


要查看或添加评论,请登录

Shubham Gupta的更多文章

  • MySQL Script on ubuntu-server

    MySQL Script on ubuntu-server

    set-hostname sudo hostnamectl set-hostname mysql_script.server hostname write a script in file name mysql_setup.

    1 条评论
  • NFS (Network File System)

    NFS (Network File System)

    Network File System allows a system to share directories and files with others over a network. By using NFS, users and…

    1 条评论
  • To Configure a Mail Server on RHEL v9 m/c ...

    To Configure a Mail Server on RHEL v9 m/c ...

    Mail Server is a software program that sends and receives email. Often, it is used as a blanket term for both mail…

  • Difference B/w Apache webserver vs Nginx webserver ??

    Difference B/w Apache webserver vs Nginx webserver ??

    Comparision : Apache vs Nginx web-server..

社区洞察

其他会员也浏览了