1. grafana-部署对数据可视化

  • grafana-部署

    Grafana是一个开源的度量分析和可视化系统。

    部署文档:https://grafana.com/grafana/download

    访问地址:http://IP:3000

    用户名/密码:admin/admin#第一次需要重置密码

  • 这里使用二进制进行安装

    • 下载二进制包

      [root@iZj6cbgktk3zjpge312vq2Z ~]# wget https://dl.grafana.com/oss/release/grafana-7.5.7.linux-amd64.tar.gz
      
    • 解压

      [root@iZj6cbgktk3zjpge312vq2Z ~]# tar -zxvf grafana-7.5.7.linux-amd64.tar.gz
      
    • 拷贝路径

      [root@iZj6cbgktk3zjpge312vq2Z ~]# mv grafana-7.5.7 /opt/monitor/
      [root@iZj6cbgktk3zjpge312vq2Z ~]# cd /opt/monitor/
      [root@iZj6cbgktk3zjpge312vq2Z opt]# mv grafana-7.5.7 grafana
      
    • 启动服务测试

      [root@iZj6cbgktk3zjpge312vq2Z monitor]# cd grafana/
      [root@iZj6cbgktk3zjpge312vq2Z grafana]# cd bin/
      [root@iZj6cbgktk3zjpge312vq2Z bin]# ./grafana-
      grafana-cli     grafana-server
      [root@iZj6cbgktk3zjpge312vq2Z bin]# ./grafana-server
      
    • 浏览器测试

      http://127.0.0.1:3000/login
      image

    • 编写系统配置服务

      [root@iZj6cbgktk3zjpge312vq2Z bin]# cd  /usr/lib/systemd/system/
      [root@iZj6cbgktk3zjpge312vq2Z system]# vi grafana.service
      [root@iZj6cbgktk3zjpge312vq2Z system]# cat grafana.service
      [Unit]
      Description=grafana
      
      [Service]
      ExecStart=/opt/monitor/grafana/bin/grafana-server -homepath=/opt/monitor/grafana
      ExecReload=/bin/kill -HUP $MAINPID
      KillMode=process
      Restart=on-failure
      
      [Install]
      WantedBy=multi-user.target
      
    • 启动系统服务

      [root@iZj6cbgktk3zjpge312vq2Z system]# systemctl daemon-reload
      [root@iZj6cbgktk3zjpge312vq2Z system]# systemctl start grafana
      [root@iZj6cbgktk3zjpge312vq2Z system]# systemctl enable grafana
      
    • 浏览器访问 http://ip:3000

      用户密码:admin/admin
      image