Prometheus MySQL_exporter
MySQL Exporter
mysqld_exporter是用来搜集mysql的性能指标的,适用于mysql5.5及其以上版本
程序安装
下载地址:https://prometheus.io/download/#mysqld_exporter
安装mysqld_exporter
tar -zxvf mysqld_exporter-0.11.0.linux-amd64.tar.gz
mv mysqld_exporter-0.11.0.linux-amd64 /usr/local/mysqld_exporter
赋权
mysqld_exporter需要连接到Mysql,所以需要Mysql的权限,我们先为它创建用户并赋予所需的权限:
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'abc123' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost';
创建.my.cnf文件
cd /usr/local/mysqld_exporter
cat << EOF > .my.cnf
[client]
user=exporter
password=abc123
EOF
创建systemd服务
cat <<EOF > /etc/systemd/system/mysqld_exporter.service
[Unit]
Description=mysqld_exporter
After=network.target [Service]
Type=simple
User=prometheus
ExecStart=/usr/local/mysqld_exporter/mysqld_exporter --config.my-cnf=/usr/local/mysqld_exporter/.my.cnf
Restart=on-failure [Install]
WantedBy=multi-user.target
EOF
启动myslqd_exporter
systemctl daemon-reload
systemctl start mysqld_exporter
systemctl status mysqld_exporter
systemctl enable mysqld_exporter
验证
curl localhost:9104/metrics
拉取数据
利用 Prometheus 的 static_configs 来拉取 mysqld_exporter 的数据。
编辑prometheus.yml文件,添加内容
- job_name: 'mysql'
static_configs:
- targets: ['localhost:9104']
重启prometheus,然后在Prometheus页面中的Targets中就能看到新加入的mysql
MySQL exporter Dashboard 模板
搜索mysql的Grafana Dashboard,导入进去
Prometheus MySQL_exporter的更多相关文章
- Prometheus+Grafana打造Mysql监控平台
prometheus/node_exporter/mysqld_exporter都是由go语言编写,需要先安装GoLang环境 下载node_exporter(监控服务器的CPU.内存.存储使用情况) ...
- prometheus监控linux系统
安装node exporter 创建Systemd服务 #vim /etc/systemd/system/node_exporter.service[Unit]Description=mysql_ex ...
- prometheus监控mysql
创建一个用于mysqld_exporter连接到MySQL的用户并赋予所需的权限 mysql> GRANT REPLICATION CLIENT, PROCESS ON *.* TO '; my ...
- Prometheus Operator 监控Kubernetes
Prometheus Operator 监控Kubernetes 1. Prometheus的基本架构 Prometheus是一个开源的完整监控解决方案,涵盖数据采集.查询.告警.展示整个监控流程 ...
- centos7下安装配置prometheus
prometheus官网:https://prometheus.io/download/ 搭建环境参考:https://blog.csdn.net/baidu_36943075/article/det ...
- Prometheus 监控Mysql服务器及Grafana可视化
Prometheus 监控Mysql服务器及Grafana可视化. mysql_exporter:用于收集MySQL性能信息. 使用版本 mysqld_exporter 0.11.0 官方地址 使用文 ...
- Prometheus初体验(三)
一.安装部署 Prometheus基于Golang编写,编译后的软件包,不依赖于任何的第三方依赖.用户只需要下载对应平台的二进制包,解压并且添加基本的配置即可正常启动Prometheus Server ...
- prometheus+grafana监控mysql
prometheus+grafana监控mysql 1.安装配置MySQL官方的 Yum Repository(有mysql只需设置监控账号即可) [root@localhost ~]# wget - ...
- 实战 Prometheus 搭建监控系统
实战 Prometheus 搭建监控系统 Prometheus 是一款基于时序数据库的开源监控告警系统,说起 Prometheus 则不得不提 SoundCloud,这是一个在线音乐分享的平台,类似于 ...
随机推荐
- VS2013软件的安装和单元测试
VS2013是什么? 微软在Builder 2013开发者大会上发布了Visual Studio 2013预览版,并且发布其程序组件库.NET 4.5.1的预览版.该软件已于北京时间2013年11月1 ...
- Windows10安装ubuntu & caffe GPU版
1.Ubuntu https://www.cnblogs.com/EasonJim/p/7112413.html https://blog.csdn.net/jesse_mx/article/deta ...
- [ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.5.0-rc1:compile (default) on project zeus-web: Command 解决
在编译maven项目,打包maven packeage -Dmaven.test.skip=TRUE时,报错“[ERROR] Failed to execute goal org.codehaus.m ...
- MySQLi面向对象实践--insert、update、delete
执行insert <?php $mysqli = new Mysqli(); $mysqli->connect("localhost","root" ...
- 变更RHEL(Red Hat Enterprise Linux 5.8)更新源使之自动更新
HP 4411s Install Red Hat Enterprise Linux 5.8) pick up from http://blog.chinaunix.net/uid-423637-id- ...
- VM虚拟机—JVM内存
JVM在运行时将数据划分为了5个区域来存储,这5个区域图示如下: 其中方法区和堆对是所有线程共享的内存区域:而java栈.本地方法栈和程序员计数器是运行时线程私有的内存区域. 首先我们熟悉一下一个 J ...
- [转帖]Gartner预测2019年全球IT支出将达到3.8万亿美元
Gartner预测2019年全球IT支出将达到3.8万亿美元 http://server.zhiding.cn/server/2019/0130/3115439.shtml 全球领先的信息技术研究和顾 ...
- Jquery 事件冒泡、元素的默认行为的阻止、获取事件类型、触发事件
$(function(){// 事件冒泡 $('').bind("click",function(event){ //事件内容 //停止事件冒泡 event.stopPropaga ...
- Java微信二次开发(四)
自定义文字菜单,暂时先实现一个根据用户输入城市名称来查询邮政编码和查询区号的功能 需要导入库:mysql-connector-java-5.0.8-bin.jar 第一步:利用Navicat新建一个用 ...
- jquery 選擇器
jquery 選擇器有: 元素選擇器: $("p")選擇所有<p> $("p.intro")選擇所有class=“intro”的<p> ...