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

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,后续会分享更多配置和使用方式。

 

博主:测试生财(一个不为996而996的测开码农)

座右铭:专注测试开发与自动化运维,努力读书思考写作,为内卷的人生奠定财务自由。

内容范畴:技术提升,职场杂谈,事业发展,阅读写作,投资理财,健康人生。

csdn:https://blog.csdn.net/ccgshigao

博客园:https://www.cnblogs.com/qa-freeroad/

51cto:https://blog.51cto.com/14900374

微信公众号:测试生财(定期分享独家内容和资源)

posted @ 2020-07-29 16:36  公众号-测试生财  阅读(162)  评论(0编辑  收藏  举报