网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
+ **上传安装**
```
cd ~
rz
tar zxvf node_exporter-1.1.2.linux-amd64.tar.gz -C /opt/prometheus-2.26/
mv /opt/prometheus-2.26/node_exporter-1.1.2.linux-amd64 /opt/prometheus-2.26/node_exporter
```
+ **注册**
```
# 创建并编辑文件
vim /etc/systemd/system/node_exporter.service
```
```
[Unit]
Description=node_exporter
Documentation=Prometheus node_exporter plugin
[Service]
ExecStart=/opt/prometheus-2.26/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
+ **启动**
```
# 设置开机自启动
systemctl enable node_exporter
# 启动服务
systemctl start node_exporter
# 查看服务状态
systemctl status node_exporter
```
+ **配置Prometheus**
```
vim /opt/prometheus-2.26/prometheus.yml
```
```
scrape\_configs:
- job\_name: 'prometheus'
static\_configs:
- targets: ['localhost:9090']
# 增加以下内容
- job\_name: 'linux'
static\_configs:
- targets: ['localhost:9100']
labels:
instance: node1
```
- 重启prometheus
```
systemctl restart prometheus.service
```
+ **验证**:http://node1:9090
![image-20211005184614853](https://img-blog.csdnimg.cn/img_convert/cb2e40e8b4388aa77ee2f12218db4bac.png)
![image-20211005184633663](https://img-blog.csdnimg.cn/img_convert/7234555b38acdc00315933dd4e6734bc.png)
- 查看当前主机的CPU使用情况:node\_cpu\_seconds\_total
![image-20211005184748505](https://img-blog.csdnimg.cn/img_convert/003cd943a9d23874e753d2350e5d5ded.png)
- 查看当前主机的CPU负载情况 :node\_load15
![image-20211005184828208](https://img-blog.csdnimg.cn/img_convert/470ee8ff7c861f04f665a62b333cffd4.png)
-
小结
- 实现node_exporter插件的安装监控Linux指标
07:mysqld_exportor插件
-
目标:实现mysqld_exportor插件的安装监控MySQL指标
-
实施
- 上传安装
cd ~ rz tar zxvf mysqld_exporter-0.13.0-rc.0.linux-amd64.tar.gz -C /opt/prometheus-2.26/ mv /opt/prometheus-2.26/mysqld_exporter-0.13.0-rc.0.linux-amd64/ /opt/prometheus-2.26/mysqld_exporter/
- 配置MySQL用户授权
mysql -uroot -p SHOW VARIABLES LIKE 'validate\_password%'; set global validate_password_policy=LOW; set global validate_password_length=6; # 授权 GRANT PROCESS, REPLICATION CLIENT, SELECT ON \*.\* TO 'mysql\_exporter'@'localhost' IDENTIFIED BY '123456' WITH MAX_USER_CONNECTIONS 3; flush privileges;
- DDL:数据定义语言:建库建表 - DML:数据操作语言:增删改 - DQL:数据查询语言:查询 - DCL:grant、revoke
- 注册服务
vim /etc/systemd/system/mysqld_exporter.service
[Unit] Description=mysqld_exporter Documentation=Prometheus mysql exporter plugin [Service] Type=simple User=mysql Environment=DATA_SOURCE_NAME=mysql_exporter:123456@(localhost:3306)/ ExecStart=/opt/prometheus-2.26/mysqld_exporter/mysqld_exporter --config.my-cnf /etc/my.cnf \ --collect.slave\_status \
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
阶课程,涵盖了95%以上大数据知识点,真正体系化!**
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新