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
037d622e
Commit
037d622e
authored
Jun 09, 2022
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitoring as-is init
parent
e6caec8c
Pipeline
#5735
passed with stages
in 1 minute and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
183 additions
and
0 deletions
+183
-0
README.md
DEVOPS/AS-IS/README.md
+183
-0
No files found.
DEVOPS/AS-IS/README.md
0 → 100644
View file @
037d622e
[
![logo
](
https://www.hongsnet.net/images/logo.gif
)
](https://www.hongsnet.net)
# 모니터링 주요 시스템 구성 내역
## Telegraf
`시스템의 주요 리소스를 모두 수집하는 Agent`
로서, 다양한 Output을 지원하지만, 여기서는 InfluxDB로의 입수를 기준으로 하며, 설정은 다음과 같다.
!참고 :
**Master/Backup**
InfluxDB로의 동시 입수를 진행하는 설정이며, 각 도메인은 Web Proxy(Nginx) 이다.
```
bash
# cat /etc/telegraf/telegraf.conf
...중략
[[
outputs.influxdb]]
urls
=
[
"http://gateway.com:8086"
]
database
=
"디비명"
skip_database_creation
=
true
retention_policy
=
""
write_consistency
=
"any"
timeout
=
"10s"
username
=
"유저명"
password
=
"패스워드"
[[
outputs.influxdb]]
urls
=
[
"http://gateway-bak.com:8086"
]
database
=
"디비명"
skip_database_creation
=
true
retention_policy
=
""
write_consistency
=
"any"
timeout
=
"10s"
username
=
"유저명"
password
=
"패스워드"
```
## Gateway (Web Proxy)
`Gateway 역할은 Telegraf 등의 구성 요소의 진입점`
이며, 목적지는 InfluxDB 이다. Application은 Nginx로 구성되어 있으며, 설정은 다음과 같다.
```
bash
user nginx
;
worker_processes auto
;
worker_rlimit_nofile 65536
;
#ulimit -n 65536
worker_rlimit_core 4g
;
working_directory /stg/core
;
error_log /var/log/nginx/error.log warn
;
pid /var/run/nginx.pid
;
events
{
worker_connections 1024
;
}
http
{
log_format main
'$remote_addr $host [$time_iso8601] "$request" '
'$status $request_time $bytes_sent "$http_referer" '
'"$http_user_agent" [$body_bytes_sent] "$http_x_forwarded_for"'
;
#'"$http_user_agent" "$http_x_forwarded_for"';
#'"$http_user_agent" [$request_body] "$http_x_forwarded_for"';
server_tokens off
;
autoindex off
;
resolver 127.0.0.1
;
vhost_traffic_status_zone
;
upstream influxdb_ha
{
server Influxdb_master:8086
max_fails
=
10
fail_timeout
=
30s
;
keepalive 50
;
}
upstream influxdb_ha_bak
{
server Influxdb_backup:8086
max_fails
=
10
fail_timeout
=
30s
;
keepalive 50
;
}
# Telegraf -> Influxdb(Master)
server
{
listen 8086
;
server_name gateway.com
;
#access_log off;
access_log /var/log/nginx/telegraf_master.access.log main
;
client_body_buffer_size 10m
;
client_max_body_size 10m
;
keepalive_timeout 10s
;
set
$upstream
http://influxdb_ha
;
location /
{
set
$agent
$http_user_agent
;
vhost_traffic_status_filter_by_set_key root-
$agent
;
proxy_cache off
;
proxy_pass
$upstream$request_uri
;
}
location /query
{
set
$rip
$remote_addr
;
vhost_traffic_status_filter_by_set_key query
;
access_log off
;
proxy_cache off
;
proxy_pass
$upstream$request_uri
;
}
location /write
{
set
$agent
$http_user_agent
;
vhost_traffic_status_filter_by_set_key write
;
proxy_cache off
;
proxy_pass
$upstream$request_uri
;
}
location /status/vts
{
vhost_traffic_status_filter_by_set_key status
;
access_log /var/log/nginx/vts.access.log main
;
allow 127.0.0.1
;
deny all
;
vhost_traffic_status_display
;
vhost_traffic_status_display_format html
;
}
}
# Telegraf -> Influxdb(Backup)
server
{
listen 8086
;
server_name gateway-bak.com
;
access_log /var/log/nginx/telegraf_backup.access.log main
;
client_body_buffer_size 10m
;
client_max_body_size 10m
;
location /
{
set
$upstream
http://influxdb_ha_bak
;
proxy_cache off
;
proxy_pass
$upstream$request_uri
;
}
}
}
```
## Kapacitor
`Kapacitor의 역할은 정의된 Tick 스크립트의 조건에 맞는 데이터를 InfluxDB에 입수`
하는 역할을 담당 한다.
설정은 다음과 같다.
```
bash
# cat /etc/kapacitor/kapacitor.conf
...중략
[[
influxdb]]
enabled
=
true
default
=
false
name
=
"lg_influx01"
urls
=
[
"http://gateway.com:8086"
]
username
=
"유저명"
password
=
"패스워드"
timeout
=
0
insecure-skip-verify
=
false
startup-timeout
=
"5m"
disable-subscriptions
=
true
subscription-mode
=
"server"
subscription-protocol
=
"http"
subscriptions-sync-interval
=
"1m0s"
kapacitor-hostname
=
""
http-port
=
0
udp-bind
=
""
udp-buffer
=
2000
udp-read-buffer
=
0
```
## 그 외 구성 요소
위의 설명된 구성 요소는 다음과 같다.
*
모니터링 UI/UX
*
모니터링 Alert API
*
Data Visualization (Grafana)
*
모니터링 데이터(InfluxDB)를 필요로 하는 별도 API
즉, 모든 구성 요소들이 모두 InfluxDB를 참조하는 서비스 구성 이다.
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