prometheus目录下的文件和目录概览
[root@aliyun-hk-yabo-prod-jiranew prometheus210]# ll
total 117924
drwxr-xr-x 2 3434 3434 4096 May 25 21:54 console_libraries
drwxr-xr-x 2 3434 3434 4096 May 25 21:54 consoles
drwxr-xr-x 21 root root 4096 Jul 8 03:00 data
-rw-r--r-- 1 3434 3434 11357 May 25 21:54 LICENSE
-rw-r--r-- 1 3434 3434 2770 May 25 21:54 NOTICE
-rwxr-xr-x 1 3434 3434 74561203 May 25 20:29 prometheus
-rw-r--r-- 1 3434 3434 1232 Jun 30 01:17 prometheus.yml
-rwxr-xr-x 1 3434 3434 46152675 May 25 20:31 promtool
我们需要关注的主要文件
data 为数据目录
prometheus 为程序二进制文件
prometheus.ym 为prometheus主配置文件
1) data目录
01**** 开头的这些文件为历史数据文件目录
wal 数据保护文件目录,prometheus为了防止数据的突然断电等情况,如果出现断电状况恢复后wal下的文件会恢复到内存中
2) 主配置文件
[root@aliyun-hk-yabo-prod-jiranew prometheus210]# cat prometheus.yml
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- 127.0.0.1:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
- job_name: 'jira-xxxxxx'
static_configs:
- targets: ['IP:9100']
labels:
instance: jira-old
注:prometheus服务器默认监听端口为9090 ,client端默认监听9100