(2)node_exporter部署监控容器主机
admin
2023-03-01 16:42:20
0

监控容器服务器CPU、内存、磁盘、I/O等信息,首先需要安装node_exporter。node_exporter的作用是用于机器系统数据收集。

(1)下载node_exporter
https://prometheus.io/download/
shell> cd /Download/
shell> wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz

(2)解压安装
shell> tar -xvf node_exporter-0.18.1.linux-amd64.tar.gz
shell>cd node_exporter-0.18.1.linux-amd64
shell> mv node_exporter-0.18.1.linux-amd64 node_exporter
shell> chown -R prometheus.prometheus node_exporter
shell> systemctl restart node_exporter
shell>systemctl status node_exporter
shell>netstat -tunlp | grep node_exporter

(3)创建systemd服务
shell>cat > /etc/systemd/system/node_exporter.service << EOF
[Unit]
Description=node_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/Download/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF

shell>systemctl daemon-reload
shell> systemctl start node_exporter #启动node_exporter服务
shell> systemctl status node_exporter

(4)prometheus_server 中添加job
shell> vim /Download/prometheus/prometheus.yml

  • job_name: 'docker39'
    scrape_interval: 5s
    static_configs:
    • targets: ['10.10.204.39:9100']
      labels:

shell>systemctl restart prometheus #重启prometheus服务

(5)查看prometheus控制台是否获取到了数据
浏览器->x.x.x.x:9090 ->status->targets 就可以看到所监控的node

相关内容

热门资讯

“抢人大战”,风向有变? 各地一场“抢老人”的大战,已然徐徐拉开大幕。最近,有着人口净流出压力的吉林,计划拿出3亿元发展旅居康...
石家庄一家不限量的爱心素食面馆... 7月24日正午时分,记者来到位于石家庄市新华区东明家居西二环店北门旁的“素面”小店,不大的店面里坐满...
中材科技申请风电叶片外补强辅助... 国家知识产权局信息显示,中材科技(伊吾)风电叶片有限公司申请一项名为“风电叶片外补强辅助固化装置”的...
为人工智能治理提供重要公共产品 图为2026世界人工智能大会暨人工智能全球治理高级别会议举办期间,在世博展览馆灵心巧手展位,参观者观...
泽连斯基称俄对乌多地发动大规模... 当地时间25日,乌克兰总统泽连斯基通报称,俄军于当日凌晨对乌克兰多地发动大规模空袭,使用2枚导弹、近...
不怕没水!武汉科学家找到水稻身... 干旱来了,水稻启动"抗旱模式",可一启动就长不大、结得少——这是困扰育种界几十年的老难题。7月23日...
多款手机涨价超1000元,大存... 今年暑期消费旺季,国内智能手机市场迎来一轮显著的价格上调。第一财经记者走访深圳多家品牌门店发现,以v...
SpaceX上市后星舰首飞:首... 界面新闻实习记者 | 李响 在经历多次波折后,SpaceX公司的星舰(Starship)终于完成了...
博世洗衣机强制解锁 博世洗衣机强制解锁的方法可能因型号和具体情况而异。以下是一些常见的方法:1. 按住电源键:有些博世洗...
美的电热水器不能出水了该怎么处... 美的电热水器不能出水了该怎么处理?1、管路堵塞,管路因水垢、杂物或冻堵等原因堵塞,热水自然就不能出水...