abednarik.mysqld-exporter
Ansible 角色:MySQL 导出器
这是一个 Ansible 角色,用于在 RedHat/CentOS 或 Debian/Ubuntu 上安装 MySQL 导出器。
需求
具有以下权限的 MySQL 用户
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT PROCESS, REPLICATION CLIENT,
SELECT ON *.* TO 'exporter'@'localhost' WITH MAX_USER_CONNECTIONS 3;
FLUSH PRIVILEGES;
注意:建议为用户设置最大连接限制,以避免在高负载下监控抓取时服务器过载。
角色变量
必需变量
mysql_exporter 的用户、密码、主机和端口。
prometheus_mysqld_exporter_env: 'user:password@(hostname:port)/'
可选变量:常规设置
用户可配置的默认值:
prometheus_user: prometheus
prometheus_group: prometheus
prometheus_mysqld_exporter_version: 0.9.0
gosu_version: '1.10'
prometheus_install_path: /opt/prometheus
prometheus_log_path: /var/log/prometheus
prometheus_pid_path: /var/run/prometheus
依赖
无。
示例剧本
- hosts: all
become: True
roles:
- abednarik.mysqld-exporter
vars:
prometheus_mysqld_exporter_env: 'exporter:password@(localhost:3306)/'
许可证
作者信息
该角色由 Alejandro Bednarik 于 2016 年创建。
说明
该角色基于 William-Yeh 的卓越工作,使用 ansible/prometheus。更多信息请查看 https://github.com/William-Yeh/ansible-prometheus。
安装
ansible-galaxy install abednarik.mysqld-exporter
许可证
gpl-3.0
下载
489
拥有者
Proactive and responsible DevOps / System Engineer and Technical Lead with over 10 years of experience in IT Systems and Open Source.