prometheus 的安装和配置
[[Prometheus]] [[Monitoring]] prometheus 的安装和配置 Prometheus 是一个开放性的监控解决方案,用户可以非常方便的安装和使用 Prometheus 并且能够非常方便的对其进行扩展。为了能够更加直观的了解 Prometheus Server,接下来我们将在本地部署并运行一个 Prometheus Server实例,通过 Node Exporter 采集当前主机的系统资源使用情况。 并通过 Grafana 创建一个简单的可视化仪表盘。 Prometheus 基于 Golang 编写,编译后的软件包,不依赖于任何的第三方依赖。用户只需要下载对应平台的二进制包,解压并且添加基本的配置即可正常启动 Prometheus Server。具体安装过程可以参考如下内容。 以 Centos7 为系统环境。 部署 prometheus 安装 prometheus wget https://github.com/prometheus/prometheus/releases/download/v2.9.2/prometheus-2.9.2.linux-amd64.tar.gz tar xzvf prometheus-2.9.2.linux-amd64.tar.gz mv prometheus-2.9.2.linux-amd64 /usr/local/prometheus 添加 prometheus 用户,非必须 groupadd prometheus useradd -g prometheus -m -d /var/lib/prometheus -s /sbin/nologin prometheus prometheus 系统服务配置 vim /etc/systemd/system/prometheus.service [Unit] Description=prometheus After=network.target [Service] Type=simple User=prometheus ExecStart=/usr/local/prometheus/prometheus -config.file=/usr/local/prometheus/prometheus.yml -storage.local.path=/var/lib/prometheus Restart=on-failure [Install] WantedBy=multi-user.target 启动 prometheus systemctl start prometheus systemctl status prometheus 部署 node_exporter 安装在将要监控的主机上。 ...