github:https://github.com/prometheus
Prometheus安装
1)下载安装
线上统一版本为 2.12.0,下载地址:
https://github.com/prometheus/prometheus/releases/download/v2.12.0/prometheus-2.12.0.linux-amd64.tar.gz
启动方式,不要默认启动
–config.file=“prometheus.yml” #启动的配置文件
–web.listen-address=“0.0.0.0:9090” #监听的地址端口
–web.max-connections=512 #最大连接数
–storage.tsdb.path="/data/prometheus" #本地存储的位置
–storage.tsdb.retention.time=15d #数据在本地存储的时间
–storage.tsdb.no-lockfile #不允许在数据目录里面创建锁文件
–query.timeout=2m #查询超时时间
–query.max-concurrency=20 #同时查询的并发数
启动命令
nohup prometheus --config.file=prometheus.yml --storage.tsdb.path=/data/prometheus --web.listen-address=“0.0.0.0:9090” --web.max-connections=512 --storage.tsdb.retention.time=15d --query.timeout=2m --query.max-concurrency=20 &
2)默认访问 http://localhost:9090/
2.文件变更后的热更新方式(prometheus.yml和rules文件变更后默认不会自动更新)
#方式1:找到Prometheus的进程ID,然后执行
kill -HUP pid
#方式2:开启配置文件热加载,Prometheus启动时在参数中加入–web.enable-lifecycle(该参数默认关闭),
./prometheus --web.enable-lifecycle
#然后执行curl命令刷新配置
curl -X POST http://IP:port/-/reload
AlertManager安装
1)下载安装
https://github.com/prometheus/alertmanager/releases/download/v0.18.0/alertmanager-0.18.0.linux-amd64.tar.gz
2)默认访问 http://localhost:9093/
Pushgateway安装
1)下载安装
https://github.com/prometheus/pushgateway/releases/download/v1.1.0/pushgateway-1.1.0.linux-amd64.tar.gz
2)默认访问 http://localhost:9091/
NodeExporter安装
1)下载安装
https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
2)默认访问 http://localhost:9100/