Skip to content

Commit aa78d2a

Browse files
Merge pull request #7 from searchmetrics/develop
Logging specifications
2 parents 594338a + 3b19bdb commit aa78d2a

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This role requires Ansible 2.0 or higher.
2323
# host
2424
clickhouse_docker_host_data_folder: "/docker/clickhouse-data"
2525
clickhouse_docker_host_config_folder: "/docker/clickhouse-config"
26+
clickhouse_docker_host_logs_folder: "/docker/clickhouse-logs"
2627

2728
# docker
2829
clickhouse_docker_version: latest
@@ -32,6 +33,7 @@ clickhouse_docker_container_name: clickhouse
3233
clickhouse_docker_bind_mounts:
3334
- "{{clickhouse_docker_host_data_folder}}:/var/lib/clickhouse"
3435
- "{{clickhouse_docker_host_config_folder}}:/etc/clickhouse-server/conf.d"
36+
- "{{clickhouse_docker_host_logs_folder}}:/var/log/clickhouse-server"
3537
clickhouse_docker_ulimits:
3638
- "nofile:262144:262144"
3739
clickhouse_docker_published_ports:
@@ -41,7 +43,9 @@ clickhouse_docker_published_ports:
4143
clickhouse_docker_exposed_ports:
4244
- 8123
4345
- 9000
44-
- 9009
46+
- 9009
47+
clickhouse_docker_log_driver: json-file
48+
clickhouse_docker_log_options:
4549
```
4650
4751
##### ClickHouse server settings
@@ -128,6 +132,10 @@ clickhouse_docker_user_profiles:
128132
http_port: 8124
129133
tcp_port: 9001
130134
listen_host: 0.0.0.0
135+
- clickhouse_docker_log_driver: syslog
136+
- clickhouse_docker_log_options:
137+
syslog-facility: local0
138+
tag: "{{ clickhouse_docker_container_name }}"
131139
roles:
132140
- ansible-role-docker-clickhouse
133141
```

defaults/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# host
33
clickhouse_docker_host_data_folder: "/tmp/docker-clickhouse-data"
44
clickhouse_docker_host_config_folder: "/tmp/docker-clickhouse-config"
5+
clickhouse_docker_host_logs_folder: "/tmp/docker-clickhouse-logs"
56

67
# docker
78
clickhouse_docker_version: latest
@@ -12,6 +13,7 @@ clickhouse_docker_container_name: clickhouse
1213
clickhouse_docker_bind_mounts:
1314
- "{{clickhouse_docker_host_data_folder}}:/var/lib/clickhouse"
1415
- "{{clickhouse_docker_host_config_folder}}:/etc/clickhouse-server/conf.d"
16+
- "{{clickhouse_docker_host_logs_folder}}:/var/log/clickhouse-server"
1517
clickhouse_docker_ulimits:
1618
- "nofile:262144:262144"
1719
clickhouse_docker_published_ports:
@@ -22,6 +24,8 @@ clickhouse_docker_exposed_ports:
2224
- 8123
2325
- 9000
2426
- 9009
27+
clickhouse_docker_log_driver: json-file
28+
clickhouse_docker_log_options:
2529

2630
clickhouse_docker_purge_networks: no
2731

tasks/docker.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
docker_container:
55
name: "{{ clickhouse_docker_container_name }}"
66
image: yandex/clickhouse-server:{{ clickhouse_docker_version }}
7-
state: started
7+
restart_policy: always
88
restart: "{{ clickhouse_docker_restart }}"
99
network_mode: "{{ clickhouse_docker_network_mode }}"
1010
networks: "{{ clickhouse_docker_networks }}"
@@ -13,3 +13,5 @@
1313
published_ports: "{{ clickhouse_docker_published_ports }}"
1414
exposed_ports: "{{ clickhouse_docker_exposed_ports }}"
1515
purge_networks: "{{ clickhouse_docker_purge_networks }}"
16+
log_driver: "{{ clickhouse_docker_log_driver }}"
17+
log_options: "{{ clickhouse_docker_log_options }}"

tasks/folder.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
with_items:
99
- "{{ clickhouse_docker_host_data_folder }}"
1010
- "{{ clickhouse_docker_host_config_folder }}"
11+
- "{{ clickhouse_docker_host_logs_folder }}"

0 commit comments

Comments
 (0)