我用 docker 部署 prometheus
安装 Master 首先把所以机器名配置在 /etc/hosts 文件中。 配置文件 : /etc/prometheus/prometheus.yml 内容如下: global: scrape_interval: 15s evaluation_interval: 15s alerting: alertmanagers: - static_configs: - targets: rule_files: scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['localhost:9090'] - job_name: 'node_export' static_configs: - targets: - server1:9100 - server2:9100 启动命令 docker run \ --name prometheus \ -d -p 9090:9090 \ -v /etc/hosts:/etc/hosts \ -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ prom/prometheus \ --web.read-timeout=5m \ --config.file=/etc/prometheus