Open shenmingbusujiku opened 2 years ago
1.在检测的客户端安装 官网下载mysqld_exporter二进制包解压缩 wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysq ld_exporter-0.12.1.linux-amd64.tar.gz tar -xzvf mysqld_exporter-0.12.1.linux-amd64.tar.gz -C /data/ cd /data/ chown root:root mysqld_exporter-0.12.1.linux-amd64 -R ln -sv mysqld_exporter-0.12.1.linux-amd64 sha256sum mysqld_exporter-0.12.1.linux-amd64.tar.gz 2.创建MySQL授权用户 yum install mariadb-server.x86_64 -y create user 'mysqld_exporter'@'%' identified by '1'; grant process,replication client,select on . to 'mysqld_exporter'@'%'; flush privileges; 3.配置数据库认证,并启动服务,默认端口号是9104 vim /data/mysqld_exporter/.mysqld_exporter.cnf [client] user=mysqld_exporter password=1 ./mysqld_exporter --config.my-cnf='.mysqld_exporter.cnf'
与Prometheus集成
1.在检测的客户端安装 官网下载mysqld_exporter二进制包解压缩 wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysq ld_exporter-0.12.1.linux-amd64.tar.gz tar -xzvf mysqld_exporter-0.12.1.linux-amd64.tar.gz -C /data/ cd /data/ chown root:root mysqld_exporter-0.12.1.linux-amd64 -R ln -sv mysqld_exporter-0.12.1.linux-amd64 sha256sum mysqld_exporter-0.12.1.linux-amd64.tar.gz 2.创建MySQL授权用户 yum install mariadb-server.x86_64 -y create user 'mysqld_exporter'@'%' identified by '1'; grant process,replication client,select on . to 'mysqld_exporter'@'%'; flush privileges; 3.配置数据库认证,并启动服务,默认端口号是9104 vim /data/mysqld_exporter/.mysqld_exporter.cnf [client] user=mysqld_exporter password=1 ./mysqld_exporter --config.my-cnf='.mysqld_exporter.cnf'