1.prometheus下载
下载地址:Download | Prometheus
请下载LTS稳定版本
本次prometheus搭建使用prometheus-2.37.1.linux-amd64.tar.gz版本
2.上传prometheus-2.37.1.linux-amd64.tar.gz至服务器/opt目录
CentOS7.9
使用命令rz -byE上传
3.解压缩prometheus-2.37.1.linux-amd64.tar.gz
命令:
tar -zxvf prometheus-2.37.1.linux-amd64.tar.gz -C /opt
cd /opt
mv prometheus-2.37.1.linux-amd64 prometheus
chown -R root:root prometheus
[root@kibana opt]# tar -zxvf prometheus-2.37.1.linux-amd64.tar.gz -C /opt
prometheus-2.37.1.linux-amd64/
prometheus-2.37.1.linux-amd64/consoles/
prometheus-2.37.1.linux-amd64/consoles/index.html.example
prometheus-2.37.1.linux-amd64/consoles/node-cpu.html
prometheus-2.37.1.linux-amd64/consoles/node-disk.html
prometheus-2.37.1.linux-amd64/consoles/node-overview.html
prometheus-2.37.1.linux-amd64/consoles/node.html
prometheus-2.37.1.linux-amd64/consoles/prometheus-overview.html
prometheus-2.37.1.linux-amd64/consoles/prometheus.html
prometheus-2.37.1.linux-amd64/console_libraries/
prometheus-2.37.1.linux-amd64/console_libraries/menu.lib
prometheus-2.37.1.linux-amd64/console_libraries/prom.lib
prometheus-2.37.1.linux-amd64/prometheus.yml
prometheus-2.37.1.linux-amd64/LICENSE
prometheus-2.37.1.linux-amd64/NOTICE
prometheus-2.37.1.linux-amd64/prometheus
prometheus-2.37.1.linux-amd64/promtool
[root@kibana opt]# mv prometheus-2.37.1.linux-amd64 prometheus
[root@kibana opt]# chown -R root:root prometheus
[root@kibana opt]# ls -ld prometheus
drwxr-xr-x 4 root root 132 9月 12 2022 prometheus
[root@kibana opt]#
4.安装prometheus
命令:
cd /opt/prometheus
./prometheus &
[root@kibana opt]# cd prometheus/
[root@kibana prometheus]# ls
console_libraries consoles LICENSE NOTICE prometheus prometheus.yml promtool
[root@kibana prometheus]# ./prometheus &
[1] 2215
[root@kibana prometheus]# ts=2024-04-19T00:50:04.430Z caller=main.go:491 level=info msg="No time or size retention was set so using the default time retention" duration=15d
ts=2024-04-19T00:50:04.430Z caller=main.go:535 level=info msg="Starting Prometheus Server" mode=server version="(version=2.37.1, branch=HEAD, revision=1ce2197e7f9e95089bfb95cb61762b5a89a8c0da)"
ts=2024-04-19T00:50:04.430Z caller=main.go:540 level=info build_context="(go=go1.18.6, user=root@3caaaea7ba87, date=20220912-12:42:39)"
ts=2024-04-19T00:50:04.430Z caller=main.go:541 level=info host_details="(Linux 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 kibana (none))"
ts=2024-04-19T00:50:04.430Z caller=main.go:542 level=info fd_limits="(soft=1024, hard=4096)"
ts=2024-04-19T00:50:04.430Z caller=main.go:543 level=info vm_limits="(soft=unlimited, hard=unlimited)"
ts=2024-04-19T00:50:04.431Z caller=web.go:553 level=info component=web msg="Start listening for connections" address=0.0.0.0:9090
ts=2024-04-19T00:50:04.431Z caller=main.go:972 level=info msg="Starting TSDB ..."
ts=2024-04-19T00:50:04.432Z caller=tls_config.go:195 level=info component=web msg="TLS is disabled." http2=false