美文网首页
10.Prometheus 一篇就够

10.Prometheus 一篇就够

作者: starQuest | 来源:发表于2022-06-27 10:21 被阅读0次

参考博客:

https://wiki.eryajf.net/pages/2497.html#_1%E3%80%81%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2

10.0 安装路径

x.x.x.3:/home/monitor

下载

$ wget https://github.com/prometheus/prometheus/releases/download/v2.4.2/prometheus-2.4.2.linux-amd64.tar.gz

$ wget https://github.com/prometheus/alertmanager/releases/download/v0.15.2/alertmanager-0.15.2.linux-amd64.tar.gz

$ wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0/node_exporter-0.16.0.linux-amd64.tar.gz

10.1 运行用户创建

groupadd prometheus2

useradd -g prometheus2 -m -d /home/monitor/prometheus/ -s /sbin/nologin prometheus2

10.2 prometheus server安装

tar -zxvf prometheus-2.14.0.linux-amd64.tar.gz

cd /home/monitor/prometheus-2.14.0.linux-amd64

10.3****prometheus配置语法校验

./promtool check config prometheus.yml

10.4启动与自启动

./prometheus --config.file=prometheus.yml

touch /usr/lib/systemd/system/prometheus.service

chown prometheus2:prometheus2 /usr/lib/systemd/system/prometheus.service

vim /usr/lib/systemd/system/prometheus.service

配置prometheus.service

[Unit]

Description=Prometheus

Documentation=https://prometheus.io/

After=network.target

[Service]

Type=simple

User=prometheus2

--storage.tsdb.path是可选项,默认数据目录在运行目录的./dada目录中

ExecStart=/home/monitor/prometheus/prometheus --config.file=/home/monitor/prometheus/prometheus.yml --web.enable-lifecycle --storage.tsdb.path=/home/monitor/prometheus/data --storage.tsdb.retention=60d

Restart=on-failure

[Install]

WantedBy=multi-user.target

自启动

systemctl daemon-reload

systemctl enable prometheus.service

systemctl start prometheus.service

systemctl status prometheus.service

systemctl restart prometheus.service systemctl stop prometheus.service

10.5 注意

自启动失败Failed to start Prometheus. 权限问题

image.png

sudo chown -R prometheus2:prometheus2 /home/monitor/prometheus

image.png

相关文章

  • 10.Prometheus 一篇就够

    参考博客: https://wiki.eryajf.net/pages/2497.html#_1%E3%80%81...

  • 一篇就够-this指向

    this的指向 用一句话概括:this永远指向最后调用函数的对象this可以理解为JS的动态作用域,而JS默认的静...

  • 20 logstash 一篇就够

    20.1 下载 https://www.elastic.co/cn/downloads/logstash [htt...

  • HashMap源码详解一篇就够

    概述 HashMap是基于哈希表(散列表),实现Map接口的双列集合,数据结构是“链表散列”,也就是数组+链表 ,...

  • 理解Java RMI 一篇就够

    Java RMI是什么 Java RMI(Java Remote Method Invocation),即Java...

  • 一篇就够——Kotlin快速入门

    文章内容主要是基于传智播客《kotlin从零基础到进阶》的视频做的笔记。标题中的 V 是Video的缩写,V4 ...

  • 一篇就够 | 面向接口开发

    回想起去年的这个时候,我正准备学SSM框架,要说原因也没有什么深层的原因,因为是先导师兄推荐去学的、也因为学了可以...

  • gradle使用教程,一篇就够

    概述 Gradle是新一代构建工具,从0.x版本一路走来虽然国内可寻的资料多了一些,但都是比较碎片化的知识。官方的...

  • 一篇就够 | WebSocket的使用

    朋友们,好久不见,三个月没更新了,想起开博之初的目标:月更、周更,都没有做到。因为我自己的技术确实还不够到位,一知...

  • 面试大全准备一篇就够

    1,请介绍下ContentProvider 是如何实现数据共享的? https://www.jianshu.com...

网友评论

      本文标题:10.Prometheus 一篇就够

      本文链接:https://www.haomeiwen.com/subject/hnasvrtx.html