Skip to content

Commit 79f8c55

Browse files
committed
监控报警系统
1 parent 088914d commit 79f8c55

File tree

17 files changed

+5142
-1
lines changed

17 files changed

+5142
-1
lines changed

02数据存取/10clickhouse.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,35 @@
44

55
- [ClickHouse](https://github.com/ClickHouse/ClickHouse)
66
- [使用场景](https://zhuanlan.zhihu.com/p/98439924)
7+
8+
## 表引擎
9+
10+
### MergeTree
11+
12+
- ReplacingMergeTree :在数据合并期间删除排序键值相同的重复项。
13+
- CollapsingMergeTree :增加状态列`Sign`,主键相同,没成对的状态行保留,多线程情况下-1和1可能存在乱序,导致无法被删除。
14+
- VersionedCollapsingMergeTree : 为了解决CollapsingMergeTree乱序写入情况下无法正常折叠问题,新增一列`Version`,主键相同,且Version相同、Sign相反的行,在Compaction时会被删除。
15+
- SummingMergeTree : 把所有具有相同主键的行合并为一行,并根据指定的字段进行累加。
16+
- AggregatingMergeTree : SummingMergeTree只能累加,这个能进行各种聚合,需要指定聚合函数。
17+
18+
#### 功能
19+
- 按照主键排序
20+
- 如果指定了分区键,则可以使用分区
21+
- 支持数据复制
22+
- 支持数据采样
23+
- 并发/索引/分区/crud
24+
25+
### Log
26+
27+
为了需要写入许多小数据量(少于一百万行)的表的场景而开发的。
28+
29+
#### 功能
30+
- 数据被顺序append写到磁盘上;
31+
- 不支持delete、update;
32+
- 不支持index;
33+
- 不支持原子性写;
34+
- insert会阻塞select操作。
35+
36+
### Integration
37+
38+
该系统表引擎主要用于将外部数据导入到ClickHouse中,或者在ClickHouse中直接操作外部数据源。

17基础设施/0目录.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515

1616
4. [Gateway](./4Gateway.md)
1717

18-
5. [PKI体系](./5PKI.md)
18+
5. [PKI体系](./5PKI.md)
19+
20+
6. [监控报警系统](./monitor/README.md)

17基础设施/monitor/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 监控报警系统
2+
3+
## 主要组件
4+
### prometheus
5+
6+
- [prometheus](https://prometheus.io/) 时序数据库 [prometheus-book](https://yunlzheng.gitbook.io/prometheus-book/) | [prometheus.wang](https://www.prometheus.wang/)
7+
- 收集客户端
8+
- [node_exporter](https://github.com/prometheus/node_exporter)
9+
- [blackbox_exporter](https://github.com/prometheus/blackbox_exporter) | [dashboards: 9965-blackbox_exporter](https://grafana.com/grafana/dashboards/9965)
10+
11+
### grafana
12+
13+
- [grafana](https://grafana.com) 可视化 | [创建警报管理](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-grafana-managed-rule/)
14+
- [plugins](https://grafana.com/grafana/plugins/)
15+
- [clickhouse](https://grafana.com/grafana/plugins/vertamedia-clickhouse-datasource/)
16+
- [dashboards](https://grafana.com/grafana/dashboards/)
17+
- [(8919) node_exporter](https://grafana.com/grafana/dashboards/8919)
18+
- [(9965) blackbox_exporter](https://grafana.com/grafana/dashboards/9965)
19+
- [(13606) clickhouse-performance](https://grafana.com/grafana/dashboards/13606/)
20+
21+
### PrometheusAlert
22+
23+
- [PrometheusAlert](https://github.com/feiyu563/PrometheusAlert) 告警中心
24+
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
version: '3.2'
2+
3+
services:
4+
prometheus:
5+
image: prom/prometheus:latest
6+
container_name: prometheus
7+
restart: unless-stopped
8+
ports:
9+
- '9090:9090'
10+
user: '0'
11+
command:
12+
- '--config.file=/etc/prometheus/prometheus.yml'
13+
- '--storage.tsdb.path=/prometheus/data'
14+
- '--storage.tsdb.retention=90d'
15+
- '--web.enable-lifecycle'
16+
volumes:
17+
- ./etc/prometheus:/etc/prometheus
18+
- ./data/prometheus/data:/prometheus/data
19+
# depends_on:
20+
# - cadvisor
21+
22+
# cadvisor:
23+
# image: google/cadvisor:latest
24+
# container_name: cadvisor
25+
# restart: unless-stopped
26+
# ports:
27+
# - '8080:8080'
28+
# volumes:
29+
# - /:/rootfs:ro
30+
# - /var/run:/var/run:rw
31+
# - /sys:/sys:ro
32+
# - /var/lib/docker/:/var/lib/docker:ro
33+
34+
node-exporter:
35+
image: prom/node-exporter:latest
36+
container_name: node-exporter
37+
restart: unless-stopped
38+
ports:
39+
- '9100:9100'
40+
command:
41+
- '--path.procfs=/host/proc'
42+
- '--path.sysfs=/host/sys'
43+
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
44+
- '--collector.textfile.directory=/node_exporter/prom'
45+
volumes:
46+
- /proc:/host/proc
47+
- /sys:/host/sys
48+
- /:/rootfs
49+
- ./etc/node_exporter/prom:/node_exporter/prom
50+
51+
node-exporter-01:
52+
image: prom/node-exporter:latest
53+
container_name: node-exporter-01
54+
restart: unless-stopped
55+
ports:
56+
- '9101:9100'
57+
command:
58+
- '--path.procfs=/host/proc'
59+
- '--path.sysfs=/host/sys'
60+
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
61+
- '--collector.textfile.directory=/node_exporter/prom'
62+
volumes:
63+
- /proc:/host/proc
64+
- /sys:/host/sys
65+
- /:/rootfs
66+
- ./etc/node_exporter/prom:/node_exporter/prom
67+
68+
grafana:
69+
image: grafana/grafana:8.5.11
70+
container_name: grafana
71+
restart: unless-stopped
72+
ports:
73+
- '3000:3000'
74+
user: '0'
75+
volumes:
76+
- ./data/grafana8:/var/lib/grafana
77+
- ./etc/grafana/grafana.ini:/etc/grafana/grafana.ini
78+
environment:
79+
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=vertamedia-clickhouse-datasource
80+
- GF_SECURITY_ADMIN_PASSWORD=password
81+
- GF_USERS_ALLOW_SIGN_UP=false
82+
83+
prometheusalert:
84+
image: feiyu563/prometheus-alert:latest
85+
container_name: prometheusalert
86+
restart: unless-stopped
87+
ports:
88+
- '8080:8080'
89+
user: '0'
90+
volumes:
91+
- ./etc/prometheusalert/app.conf:/app/conf/app.conf
92+
environment:
93+
- GF_SECURITY_ADMIN_PASSWORD=password
94+
- PA_LOGIN_USER=prometheusalert
95+
- PA_LOGIN_PASSWORD=prometheusalert
96+
- PA_TITLE=PrometheusAlert
97+
- PA_OPEN_FEISHU=1
98+
- PA_OPEN_DINGDING=1
99+
- PA_OPEN_WEIXIN=1
100+
101+
clickhouse:
102+
image: yandex/clickhouse-server
103+
container_name: clickhouse
104+
restart: unless-stopped
105+
ports:
106+
- 34424:34424
107+
- 9000:9000
108+
- 9009:9009
109+
- 8123:8123
110+
user: '0'
111+
volumes:
112+
- ./data/clickhouse/data:/var/lib/clickhouse
113+
ulimits:
114+
nofile:
115+
soft: 262144
116+
hard: 262144
117+
118+
blackbox:
119+
image: prom/blackbox-exporter:latest
120+
container_name: blackbox
121+
restart: unless-stopped
122+
command:
123+
- "--config.file=/etc/blackbox/blackbox.yml"
124+
ports:
125+
- 9115:9115
126+
user: '0'
127+
volumes:
128+
- ./etc/blackbox/blackbox.yml:/etc/blackbox/blackbox.yml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
modules:
2+
http_2xx:
3+
prober: http
4+
http_post_2xx:
5+
prober: http
6+
http:
7+
method: POST
8+
tcp_connect:
9+
prober: tcp

0 commit comments

Comments
 (0)