This commit is contained in:
havelight-ee
2023-08-17 14:10:23 +09:00
parent 005fd3752c
commit ee773cd793
4 changed files with 64 additions and 51 deletions

View File

@@ -127,6 +127,7 @@ ansible-galaxy install dsk_bot.datasaker
|`logs[*].collect.address`|데이터베이스 host 및 port 정보 설정 (서비스 분류가 database인 경우 설정).|`None`|
|`logs[*].collect.file.paths`|로그 수집 대상 경로 설정. 예 : /var/log/sample/*.log.|`['/var/log/*.log']`|
|`logs[*].collect.file.exclude_paths`|로그 수집 제외 대상 경로 설정.|`None`|
|`custom_log_volume`| Docker 사용 시 수집할 로그가 있는 경로 마운트.|`/var/lib/docker/containers/`|
|`postgres_user_name`| `dsk-postgres-agent`에 Postgres user ID 설정. <br> | `None` |
|`postgres_user_password`| `dsk-postgres-agent`에 Postgres user password 설정. <br> | `None` |
|`postgres_database_address`| `dsk-postgres-agent`에 Postgres address 설정. <br> | `None` |
@@ -152,7 +153,7 @@ ansible-galaxy install dsk_bot.datasaker
- role: dsk_bot.datasaker
vars:
datasaker_api_key: "<YOUR_API_KEY>"
datasaker_docker_agents:
datasaker_agents:
- "dsk-node-agent"
- "dsk-trace-agent"
- "dsk-log-agent"
@@ -167,12 +168,11 @@ ansible-galaxy install dsk_bot.datasaker
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
```
#### Ansible Playbook 상세 설정 Example (Docker)
@@ -184,10 +184,10 @@ ansible-galaxy install dsk_bot.datasaker
vars:
datasaker_api_key: "<YOUR_API_KEY>"
datasaker_docker_agents:
- "dsk-docker-node-agent"
- "dsk-docker-trace-agent"
- "dsk-docker-log-agent"
- "dsk-docker-postgres-agent"
- "dsk-docker-node-agent"
- "dsk-docker-trace-agent"
- "dsk-docker-log-agent"
- "dsk-docker-postgres-agent"
postgres_user_name: sample
postgres_user_password: 1q2w3e4r
postgres_database_address: 0.0.0.0
@@ -198,12 +198,15 @@ ansible-galaxy install dsk_bot.datasaker
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
- /var/lib/docker/containers/*/*.log
custom_log_volume:
- /var/log/
- /var/lib/docker/containers
```

View File

@@ -124,6 +124,7 @@ In this example:
|`logs[*].collect.address`|Sets the database host and port information (required if service category is database).|`None`|
|`logs[*].collect.file.paths`|Sets the paths for log collection. Example: /var/log/sample/.log.|`['/var/log/*.log']`|
|`logs[*].collect.file.exclude_paths`|Sets the paths to be excluded from log collection.|`None`|
|`custom_log_volume`| Volume mount in Docker Log Agent. |`/var/lib/docker/containers`|
|`postgres_user_name`| Enter the Postgres user ID. <br> | `None` |
|`postgres_user_password`| Enter the Postgres user password. <br> | `None` |
|`postgres_database_address`| Enter the Postgres address. <br> | `None` |
@@ -152,7 +153,7 @@ In this example:
- role: dsk_bot.datasaker
vars:
datasaker_api_key: "<YOUR_API_KEY>"
datasaker_docker_agents:
datasaker_agents:
- "dsk-node-agent"
- "dsk-trace-agent"
- "dsk-log-agent"
@@ -167,12 +168,11 @@ In this example:
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
```
###### Ansible Playbook Setting Example (Docker)
@@ -198,12 +198,15 @@ In this example:
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
- /var/lib/docker/containers/*/*.log
custom_log_volume:
- /var/log/
- /var/lib/docker/containers
```
## Uninstallation

View File

@@ -19,6 +19,8 @@ ansible-galaxy install dsk_bot.datasaker
```
에이전트를 배포하기 위하여 Ansible playbook을 작성합니다.
****`dsk-log-agent` 설치 시 `fluent-bit` 이 자동으로 설치됩니다.***
@@ -125,6 +127,7 @@ ansible-galaxy install dsk_bot.datasaker
|`logs[*].collect.address`|데이터베이스 host 및 port 정보 설정 (서비스 분류가 database인 경우 설정).|`None`|
|`logs[*].collect.file.paths`|로그 수집 대상 경로 설정. 예 : /var/log/sample/*.log.|`['/var/log/*.log']`|
|`logs[*].collect.file.exclude_paths`|로그 수집 제외 대상 경로 설정.|`None`|
|`custom_log_volume`| Docker 사용 시 수집할 로그가 있는 경로 마운트.|`/var/lib/docker/containers/`|
|`postgres_user_name`| `dsk-postgres-agent`에 Postgres user ID 설정. <br> | `None` |
|`postgres_user_password`| `dsk-postgres-agent`에 Postgres user password 설정. <br> | `None` |
|`postgres_database_address`| `dsk-postgres-agent`에 Postgres address 설정. <br> | `None` |
@@ -150,7 +153,7 @@ ansible-galaxy install dsk_bot.datasaker
- role: dsk_bot.datasaker
vars:
datasaker_api_key: "<YOUR_API_KEY>"
datasaker_docker_agents:
datasaker_agents:
- "dsk-node-agent"
- "dsk-trace-agent"
- "dsk-log-agent"
@@ -165,12 +168,11 @@ ansible-galaxy install dsk_bot.datasaker
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
```
#### Ansible Playbook 상세 설정 Example (Docker)
@@ -182,10 +184,10 @@ ansible-galaxy install dsk_bot.datasaker
vars:
datasaker_api_key: "<YOUR_API_KEY>"
datasaker_docker_agents:
- "dsk-docker-node-agent"
- "dsk-docker-trace-agent"
- "dsk-docker-log-agent"
- "dsk-docker-postgres-agent"
- "dsk-docker-node-agent"
- "dsk-docker-trace-agent"
- "dsk-docker-log-agent"
- "dsk-docker-postgres-agent"
postgres_user_name: sample
postgres_user_password: 1q2w3e4r
postgres_database_address: 0.0.0.0
@@ -196,12 +198,15 @@ ansible-galaxy install dsk_bot.datasaker
plan_postgres_database_name: sample
plan_postgres_database_port: 5432
logs:
- collect:
type: file
file:
paths:
- /var/log/*.log
- /datasaker/log/*.log
- collect:
type: file
file:
paths:
- /var/log/*.log
- /var/lib/docker/containers/*/*.log
custom_log_volume:
- /var/log/
- /var/lib/docker/containers
```

View File

@@ -30,12 +30,14 @@
env:
DKS_LOG_LEVEL: "{{ log_agent_log_level }}"
command: "-global.config=/etc/datasaker/global-config.yml -agent.config=/etc/datasaker/dsk-log-agent/agent-config.yml -mount.volume=true"
volumes:
volumes: "{{ combined_volumes }}"
vars:
base_volumes:
- "{{ datasaker_docker_path }}:/var/datasaker/"
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
- "{{ datasaker_docker_path }}/dsk-docker-log-agent-config.yml:/etc/datasaker/dsk-log-agent/agent-config.yml:ro"
- "{{ item }}:{{ item }}:ro"
with_items: "{{ custom_log_volume | default(['{{ docker_default_path }}']) }}"
custom_volumes: "{{ custom_log_volume | default([docker_default_path]) | map('regex_replace', '^(.*)$', '\\1:\\1:ro') | list }}"
combined_volumes: "{{ base_volumes + custom_volumes }}"
- name: "Run APP with fluentd logging"
docker_container:
@@ -48,4 +50,4 @@
fluentd-address: "{{ log_agent_port }}:{{ log_agent_port }}"
when:
- app_name is defined
- app_image is defined
- app_image is defined