摘要: prometheus+grafana监控mysql(单一 mysql_exporter 抓取多个 mysql 主机) 部署mysqld_exporter 在prometheus机器部署即可 # 创建数据库账号,所有需要监控的mysql提供的账户密码需要一致 use mysql; CREATE USER 'exporter'@'%' IDENTIFIED BY '1qaz@WSX'; grant PROCESS, R 阅读全文
posted @ 2025-07-28 18:53 阿峰博客站 阅读(47) 评论(0) 推荐(0)
摘要: prometheus+grafana监控服务器 安装node_exporter wget https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz tar -xf node_exporter 阅读全文
posted @ 2025-07-28 17:37 阿峰博客站 阅读(16) 评论(0) 推荐(0)
摘要: prometheus概述 Prometheus server: prometheus的服务端,负责收集指标和存储时间序列数据,并提供查询接口。 exporters: 如果想要监控,前提是能获取被监控端数据,并且这个数据格式必须遵循Prometheus数据模型,这样才能识别和采集,一般使用exporter数据采集器(类似于za 阅读全文
posted @ 2025-07-28 15:40 阿峰博客站 阅读(10) 评论(0) 推荐(0)
摘要: prometheus+grafana安装与集成 部署prometheus server prometheus软件下载地址:https://prometheus.io/download/ 同步时间 我们在安装prometheus server监控软件之前,需要同步集群时间。 由于prometheus是一个时间序列数据库,因此其对系统时间的准确性要求 阅读全文
posted @ 2025-07-28 13:01 阿峰博客站 阅读(20) 评论(0) 推荐(0)
摘要: playbook剧本 playbook组成 - hosts: all #指定主机组 remote_user: root #以root用户运行 vars: #定义变量 file_name: zqf tasks: #执行任务 - name: touch test.txt shell: touch ~/test.txt pla 阅读全文
posted @ 2025-07-27 02:42 阿峰博客站 阅读(8) 评论(0) 推荐(0)
摘要: ansible的常用模块详解 ansible的常用模块 模块 作用 command 执行shell命令(不支持管道等特殊字符) 管道 shell 执行shell命令 支持特殊符号 script 执行shell脚本 yum_repository 配置yum仓库 yum源 yum 安装软件 copy 远程复制 file 创建目录或文 阅读全文
posted @ 2025-07-27 02:40 阿峰博客站 阅读(22) 评论(0) 推荐(0)
摘要: ansible的常用参数介绍 选项 含义 --version ansible的版本 -v -vv -vvvv ansible的执行显示过程,越来越详细 -i 指定主机清单的位置,默认是/etc/ansible/hosts -m 指定模块 -a 指定模块中的具体动作 -k 指定被控节点的密码 -C 检查与测试,不是真正的运行(pl 阅读全文
posted @ 2025-07-27 01:39 阿峰博客站 阅读(5) 评论(0) 推荐(0)
摘要: ansible的主机清单详解 基于密码的连接 如果是第一次登陆,需要免ssh验证的话,可以设置: vim /etc/ansible/ansible.cfg host_key_checking = False cat /etc/ansible/hosts [all] 10.0.0.11 ansible_ssh_port=22 an 阅读全文
posted @ 2025-07-27 01:35 阿峰博客站 阅读(12) 评论(0) 推荐(0)
摘要: ansible的主配置文件详解 主配置文件加载顺序 Ansible的主配置文件可以存放在任何位置,但配置文件有读取顺序 最先查找$ANSIBLE_CONFIG变量对应的位置和文件 其次查找当前目录下ansible.cfg 然后查找用户家目录下的.ansible.cfg 最后查找/etc/ansible/ansible.cfg(默认 阅读全文
posted @ 2025-07-27 01:30 阿峰博客站 阅读(14) 评论(0) 推荐(0)
摘要: ansible安装 centos安装: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo https://mirrors.al 阅读全文
posted @ 2025-07-27 01:26 阿峰博客站 阅读(10) 评论(0) 推荐(0)