Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
joohanhong
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JooHan Hong
joohanhong
Commits
938f1ee4
Commit
938f1ee4
authored
Mar 12, 2021
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prometheus init
parent
31e8c83e
Pipeline
#5195
passed with stages
in 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
0 deletions
+125
-0
README.md
DOCKER/PROMETHEUS/README.md
+125
-0
container-monitoring.png
DOCKER/PROMETHEUS/images/container-monitoring.png
+0
-0
No files found.
DOCKER/PROMETHEUS/README.md
0 → 100644
View file @
938f1ee4
[
![logo
](
https://www.hongsnet.net/images/logo.gif
)
](https://www.hongsnet.net)
# 개요
Prometheus을 이용한 www.hongsnet.net Container를 모니터링 한다.
# 구성
![
source_overview
](
./images/container-monitoring.png
)
> !참고 : Node 및 VM은 Zabbix에서 모니터링을 수행하기 때문에 node-exporter는 실행되지 않는다.
-
**k8s**
> 현재 진행중
-
**Swarm**
구성은 Docker Stack을 이용할 것이며, yml 파일의 내역은 다음과 같다.
```
bash
# cat docker-stack.yml
version:
'3'
services:
prometheus:
image: prom/prometheus
deploy:
mode: global
placement:
constraints:
[
node.hostname
==
TB2-DOCKER]
volumes:
- /GLUSTERFS/PROM/DATA/prometheus/data:/prometheus
- /GLUSTERFS/PROM/DATA/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- /GLUSTERFS/PROM/DATA/prometheus/alert.rules:/etc/prometheus/alert.rules
command
:
-
'--config.file=/etc/prometheus/prometheus.yml'
-
'--web.enable-admin-api'
-
'--storage.tsdb.retention.time=1y'
ports:
-
'9090:9090'
depends_on:
- cadvisor
cadvisor:
image: google/cadvisor:latest
deploy:
mode: global
ports:
-
"8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
grafana:
image: grafana/grafana
deploy:
mode: global
placement:
constraints:
[
node.hostname
==
TB2-DOCKER]
volumes:
- /GLUSTERFS/PROM/DATA/grafana/data:/var/lib/grafana
- /GLUSTERFS/PROM/DATA/grafana/grafana.ini:/etc/grafana/grafana.ini
environment:
-
GF_SECURITY_ADMIN_PASSWORD
=
ghdwngkstjqj
depends_on:
- prometheus
ports:
-
"3000:3000"
depends_on:
- prometheus
alertmanager:
image: prom/alertmanager
deploy:
mode: global
placement:
constraints:
[
node.hostname
==
TB2-DOCKER]
volumes:
- /GLUSTERFS/PROM/DATA/alertmanager:/etc/alertmanager/
depends_on:
- prometheus
ports:
-
'9093:9093'
```
> !중요 : cadvisor 를 제외한 구성요소는 다음의 설정에 따라 Manager Node에서만 수행된다.
```
python
placement
:
constraints
:
[
node
.
hostname
==
TB2
-
DOCKER
]
```
이제
**monitor**
서비스를 다음과 같이 실행한다.
```
bash
# docker stack deploy -c docker-stack.yml monitor
```
*
[
**Manager Node**
]
```
bash
# docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
xodct3yxupq6 monitor_alertmanager global 1/1 prom/alertmanager:latest
*
:9093->9093/tcp
zlay4qoq8gg7 monitor_cadvisor global 4/4 google/cadvisor:latest
*
:8080->8080/tcp
pfljlqixrepi monitor_grafana global 1/1 grafana/grafana:latest
*
:3000->3000/tcp
1kakkg4asokp monitor_prometheus global 1/1 prom/prometheus:latest
*
:9090->9090/tcp
hjsvav9409zy web_hongsnet global 3/3 registry.hongsnet.net/joohan.hong/docker/hongsnet:latest
*
:80->80/tcp
```
*
[
**Worker Nodes**
]
```
bash
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
93c7bdfd3dde google/cadvisor:latest
"/usr/bin/cadvisor -…"
22 hours ago Up 22 hours 8080/tcp monitor_cadvisor.t3zbiuhkpam480yfqgc78tzgn.oa8wy24n0dm7t11w0lav9k5lu
dca11cc1625a registry.hongsnet.net/joohan.hong/docker/hongsnet:latest
"/usr/bin/supervisor…"
42 hours ago Up 42 hours 80/tcp web_hongsnet.t3zbiuhkpam480yfqgc78tzgn.yyewdmnoun7jnq1l19jrip590
```
DOCKER/PROMETHEUS/images/container-monitoring.png
0 → 100644
View file @
938f1ee4
69.9 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment