美文网首页
Prometheus的伴侣:Grafana在centos下的搭建

Prometheus的伴侣:Grafana在centos下的搭建

作者: 测试生财 | 来源:发表于2020-07-29 07:39 被阅读0次

    Grafana 是一款采用 go 语言编写的开源应用,主要用于监控指标数据的可视化展现,是当前最流行的时序数据展示工具,目前已经支持绝大部分常用的时序数据库。Grafana常常搭配用作Prometheus的前端监控展示。

    一、下载grafana

    wget https://dl.grafana.com/oss/release/grafana-6.7.3-1.x86_64.rpm

    sudo yum install grafana-6.7.3-1.x86_64.rpm

    二、修改grafana.ini

    2. 1 修改dashboard配置

    [dashboards]

    # Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1

    ;versions_to_keep = 20

    enabled = true

    path = /var/lib/grafana/dashboards

    2.1 修改邮件配置配置

    [smtp]

    enabled = true ;这里要改成true

    host = smtp.126.com:25 ;这里改成对应smtp服务地址端口

    user = ccg_const2020@126.com ;这里设置邮箱号

    # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""

    password = *** ; 客户端授权码

    ;cert_file =

    ;key_file =

    skip_verify = true

    from_address = ccg_const2020@126.com

    from_name = Grafana

    # EHLO identity in SMTP dialog (defaults to instance_name)

    ;ehlo_identity = dashboard.example.com

    [emails]

    welcome_email_on_sign_up = true

    2.3 设置匿名登录

    [auth.anonymous]

    # enable anonymous access

    enabled = true

    # specify organization name that should be used for unauthenticated users

    org_name = QingCloud.

    # specify role for unauthenticated users

    org_role = Viewer

    三、安装仪表板

    3.1 安装git

    yum install -y git

    3.2 安装Dashboard

    git clone https://github.com/percona/grafana-dashboards.git

    cp -r grafana-dashboards/dashboards /var/lib/grafana/

    四、安装相关插件

    #查询可用的插件

    grafana-cli plugins list-remote

    #安装插件

    grafana-cli plugins install grafana-piechart-panel

    五、配置启动Grafana

    #启动Grafana:

    sudo service grafana-server start

    sudo service grafana-server status

    #设置开机启动:

    sudo /sbin/chkconfig --add grafana-server


    六、访问登录grafana

    访问Grafana:http://yourip:3000/ ,这里yourip替换成你实际访问的ip即可

    账号:admin

    密码:admin

    第一次登录时,系统会要求你更改密码,强烈建议你遵循Grafana的最佳做法并更改默认管理员密码,你可以稍后转到用户首选项并更改你的用户名。

    登录页面

    Grafana登录页

    至此,你已经搭建完成了Grafana,后续会分享更多配置和使用方式。

    相关文章

      网友评论

          本文标题:Prometheus的伴侣:Grafana在centos下的搭建

          本文链接:https://www.haomeiwen.com/subject/eebcrktx.html