下载地址: https://prometheus.io/download/
现在时间是: 2019.09.07
安装环境: Linux centos7 minimal 虚拟机; 宿主主机 MacOS; 软件: virtualBox 6.0.10 r132072
选用版本:
- [配置网络](https://blog.csdn.net/qq_37933685/article/details/81169794)
- [更换国内源](https://www.jianshu.com/p/e63903fd09f0)
- [【CentOS7】yum安装时出现错误[Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown e的解决办法](https://blog.csdn.net/oschina_41140683/article/details/82426831)
我是本地加速下载好压缩包上传的,所以要另外配置 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
看看输入对应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
docker run --name prometheus -d -p 127.0.0.1:9090:9090 quay.io/prometheus/prometheus