由于Prometheus是go语言写的,所以不需要编译,安装的过程非常简单,仅需要解压然后运行。
Prometheus官方下载地址:https://prometheus.io/download/

安装Prometheus server

# 解压
# tar xf prometheus-2.4..linux-amd64.tar.gz # 运行
# cd prometheus-2.4.3.linux-amd64/
# ./prometheus --config.file=prometheus.yml

node_exporter安装

# 解压
# tar xf node_exporter-0.16.0.linux-amd64.tar.gz # 运行
# cd node_exporter-0.16.0.linux-amd64/
# ./node_exporter # 验证node_exporter是否安装成功
# curl 127.0.0.1:9100 # 查看性能指标
# curl 127.0.0.1:9100/metrics

配置(关闭之前运行的node_exporter及prometheus)

创建目录

# mkdir /etc/prometheus

# 拷贝上面解压的prometheus.yml文件到/etc/prometheus
# cp /root/prometheus-2.4.3.linux-amd64/prometheus.yml /etc/prometheus/

添加启动脚本

下载地址:https://github.com/youerning/blog/tree/master/prometheus

# cp node-exporter.service /etc/init.d/node-exporter
# cp prometheus.service /etc/init.d/prometheus
# chmod +x /etc/init.d/node-exporter
# chmod +x /etc/init.d/prometheus # 创建工作目录(Prometheus的数据会存在这,启动脚本里面我写的是/data)
# mkdir /data # 启动服务
# service prometheus start
# service node-exporter start

启动prometheus服务如果出现报错:

start-stop-daemon: command not found

解决方法:

# 安装依赖包
# yum install gcc-c++ ncurses-devel -y # wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.17.25.tar.xz
# tar -xf  dpkg_1.17.25.tar.xz
# cd dpkg-1.17.25
# ./configure
# make
# cd utils
# make 
# cp start-stop-daemon /usr/sbin/

Promethus安装指南的更多相关文章

  1. nGrinder安装指南

    NGrinder 由两个模块组成,其运行环境为 Oracle JDK 1.6 nGrinder controller  web 应用程序,部署在Tomcat 6.x 或更高的版本 nGrinder A ...

  2. postgresql pgsql最新版安装指南及数据存储路径更改及主从配置

    postgresql pgsql最新版安装指南及数据存储路径更改及主从配置 安装指南 首先在apt的list添加你当前系统版本对应的apt列表 目前官网有16.04,14.04,12.04 分别对应下 ...

  3. 全新 Mac 安装指南(编程篇)(环境变量、Shell 终端、SSH 远程连接)

    注:本文专门用于指导对计算机编程与设计(尤其是互联网产品开发与设计)感兴趣的 Mac 新用户,如何在 Mac OS X 系统上配置开发与上网环境,另有<全新 Mac 安装指南(通用篇)>作 ...

  4. 全新 Mac 安装指南(通用篇)(推荐设置、软件安装、推荐软件)

    注:本文将会不定期维护与更新,有需要的朋友请在 Github 上订阅该条 Issues:<全新 Mac 安装指南(通用篇)>. 在 Mac 电脑上只用 Windows 操作系统的同学请看到 ...

  5. ArchLinux安装指南

    将ArchLinux作为进阶Linux发行版,主要看重滚动更新和深入理解Linux的安装过程. 由于是新手,所以先选择在公司电脑上用VMware来安装.然后渐进到借助U盘在win10笔记本上安装双系统 ...

  6. Linux环境中Openfire安装指南

    Linux环境中Openfire安装指南 安装环境: 安装软件:Openfire 4_1_0 http://download.igniterealtime.org/openfire/openfire_ ...

  7. scrapy3_ 安装指南

    安装指南 安装Scrapy 注解 请先阅读 平台安装指南. 下列的安装步骤假定您已经安装好下列程序: Python 2.7 Python Package: pip and setuptools. 现在 ...

  8. storm 原理简介及单机版安装指南——详细版【转】

    storm 原理简介及单机版安装指南 本文翻译自: https://github.com/nathanmarz/storm/wiki/Tutorial 原文链接自:http://www.open-op ...

  9. mac osx 系统 brew install hadoop 安装指南

    mac osx 系统 brew  install hadoop 安装指南   brew install hadoop 配置 core-site.xml:配置hdfs文件地址(记得chmod 对应文件夹 ...

随机推荐

  1. python 访问权限和下划线

    Class内部,可以有属性和方法,而外部代码可以通过直接调用实例变量的方法来操作数据 1.__xx__(两边两个下划线):是特列方法像__init__之类的,是python的内嵌的方法在特定的时候会被 ...

  2. ballerina 学习八 Parallel( 并行处理)

    实际上就是并行进行任务的处理 简单例子 代码 import ballerina/io; function main (string… args) { worker first { io:println ...

  3. 【转】linux内核态和用户态的区别

    原文网址:http://www.mike.org.cn/articles/linux-kernel-mode-and-user-mode-distinction/ 内核态与用户态是操作系统的两种运行级 ...

  4. hadoop之 distcp(分布式拷贝)

    概述 distcp(分布式拷贝)是用于大规模集群内部和集群之间拷贝的工具. 它使用Map/Reduce实现文件分发,错误处理和恢复,以及报告生成. 它把文件和目录的列表作为map任务的输入,每个任务会 ...

  5. torcs代码

    /** Info returned by driver during the race */ typedef struct { tdble steer; /**< Steer command [ ...

  6. bzoj 2178 圆的面积并——辛普森积分

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2178 把包含的圆去掉.横坐标不相交的一段一段圆分开算.算辛普森的时候预处理 f( ) ,比如 ...

  7. MySQL主从报错解决:Failed to initialize the master info structure

    大清早收到一个MySQL的自定义语言告警 :replication interrupt,看来是主从同步报错了. 登陆MySQL,执行 show slave status \G 发现salve已经停止了 ...

  8. Unit02: CSS 概述 、 CSS 语法 、 CSS 选择器 、 CSS声明

    Unit02: CSS 概述 . CSS 语法 . CSS 选择器 . CSS声明 my.css p { color: yellow; } demo1.html <!DOCTYPE html&g ...

  9. 配置PHP,Apache

    安装完windows 2003 server以后,还是个裸机,在安装limesurvey总是会有些问题,还好,问题都解决了,下面讲下配置的步骤: 第一步:先装上apache服务 apache服务启动以 ...

  10. 【BZOJ】2818: Gcd(欧拉函数+质数)

    题目 传送门:QWQ 分析 仪仗队 呃,看到题后感觉很像上面的仪仗队. 仪仗队求的是$ gcd(a,b)=1 $ 本题求的是$ gcd(a,b)=m $ 其中m是质数 把 $ gcd(a,b)=1 $ ...