Prometheus安装
下载地址: https://prometheus.io/download/
现在时间是: 2019.09.07
安装环境: Linux centos7 minimal 虚拟机; 宿主主机 MacOS; 软件: virtualBox 6.0.10 r132072
选用版本: prometheus-2.12.0.linux-amd64.tar.gz
二进制包安装
1.安装虚拟机
-
下载镜像
-
在virtualbox安装虚拟机
2.配置 以及 安装依赖
-
配置网络使用网络地址转换模式
-
主机名 配置主机名可以快速辨识
-
时钟 prometheus是个时序数据库,对时间要求极高,所以安装时间同步的工具,设置时区为东八区, Asia/shanghai 资料
#安装服务 > yum install ntp -y #开机启动 > systemctl enable ntpd #设置时区 > timedatectl set-timezone Asia/Shanghai #查看时区 > timedatectl
3.安装prometheus
我是本地加速下载好压缩包上传的,所以要另外配置 Linux上传下载文件的命令 rz
#上传下载命令
> yum install lrzsz -y
#下载
> wget https://github.com/prometheus/prometheus/releases/download/v2.12.0/prometheus-2.12.0.linux-amd64.tar.gz
#解压
> tar -zxvf prometheus-2.12.0.linux-amd64.tar.gz
# 配置环境变量
> vi /etc/profile
# 加入以下
# 设置prometheus的环境变量
PATH=$PATH
PATH=$PATH:/root/prometheus/server/prometheus-2.12.0.linux-amd64
export PATH
....
> source /etc/profile
# 启动promethus
> promethus
4.测试联通性
看看输入对应ip:9090能否进入.
如果不能,检查 ping网络状态, telnet端口是否开启
# 停止防火墙
> systemctl stop firewalld
# 关闭开机启动防火墙
> systemctl disable firewalld
# 关闭安全策略
> vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# 这里修改为disabled
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
5.安装成功
Docker安装
docker run --name prometheus -d -p 127.0.0.1:9090:9090 quay.io/prometheus/prometheus
参考资料
官网: https://prometheus.io/docs/prometheus/latest/getting_started/
https://songjiayang.gitbooks.io/prometheus/content/install/binary.html
原文出处:https://www.cnblogs.com/suveng/p/11481399.html
来源:oschina
链接:https://my.oschina.net/u/4406952/blog/3253746