mysqld-exporter部署
# 1.创建目录
[root@summer exporter]# mkdir -p /opt/exporter
[root@summer exporter]# cd /opt/exporter
1
2
2
# 2.解压
[root@summer soft]# tar zxvf mysqld_exporter-0.12.1.linux-amd64.tar.gz
mysqld_exporter-0.12.1.linux-amd64/
mysqld_exporter-0.12.1.linux-amd64/NOTICE
mysqld_exporter-0.12.1.linux-amd64/mysqld_exporter
mysqld_exporter-0.12.1.linux-amd64/LICENSE
1
2
3
4
5
2
3
4
5
# 3.修改名称
[root@summer soft]# mv mysqld_exporter-0.12.1.linux-amd64 /opt/exporter/
[root@summer soft]# cd -
/opt/exporter
[root@summer exporter]# ll
total 4
drwxr-xr-x 2 3434 3434 58 Jul 29 2019 mysqld_exporter-0.12.1.linux-amd64
drwxrwxrwx 2 3434 3434 56 Jun 16 21:19 node_exporter
-rw------- 1 root root 3974 Dec 1 11:00 nohup.out
[root@summer exporter]# mv mysqld_exporter-0.12.1.linux-amd64/ mysqld_exporter
[root@summer exporter]# ll
total 4
drwxr-xr-x 2 3434 3434 58 Jul 29 2019 mysqld_exporter
drwxrwxrwx 2 3434 3434 56 Jun 16 21:19 node_exporter
-rw------- 1 root root 3974 Dec 1 11:00 nohup.out
[root@summer exporter]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 4.创建mysql配置文件
[root@summer exporter]# vim /opt/exporter/mysqld_exporter/.my.cnf
[root@summer exporter]# cd mysqld_exporter/
[root@summer mysqld_exporter]# ll -a
total 14488
drwxr-xr-x 2 3434 3434 73 Dec 1 11:27 .
drwxr-xr-x 4 root root 67 Dec 1 11:23 ..
-rw-r--r-- 1 3434 3434 11325 Jul 29 2019 LICENSE
-rw-r--r-- 1 root root 35 Dec 1 11:27 .my.cnf
-rwxr-xr-x 1 3434 3434 14813452 Jul 29 2019 mysqld_exporter
-rw-r--r-- 1 3434 3434 65 Jul 29 2019 NOTICE
[root@summer mysqld_exporter]# pwd
/opt/exporter/mysqld_exporter
[root@summer mysqld_exporter]# cat .my.cnf
[client]
port=23306
user=root
password=summer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 5.启动服务
[root@summer exporter]# $ nohup /opt/exporter/mysqld_exporter/mysqld_exporter --config.my-cnf="/opt/exporter/mysqld_exporter/.my.cnf" &
[1] 671
1
2
2
# 6.验证
curl http://IP:9104/metrics
1
# 7.展示
- 所用模板:7362