forked from autopilotpattern/elk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
128 lines (113 loc) · 3.73 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# ELK stack designed for container-native deployment
# on Joyent's Triton platform.
# ---------------------------------------------------
# The Kibana application queries the ES cluster
kibana:
image: autopilotpattern/kibana:latest
mem_limit: 1g
restart: always
labels:
- triton.cns.services=kibana
ports:
- 5601 # default Kibana port
env_file: _env
environment:
- CONFIG_PATH=/usr/share/kibana/config/kibana.yml
- NODE_ENV=production
- CONTAINERPILOT=file:///etc/containerpilot.json
command: >
/usr/local/bin/containerpilot
/usr/share/kibana/node/bin/node
/usr/share/kibana/src/cli
# ---------------------------------------------------
# The logstash container is the target of Docker log drivers
logstash:
image: autopilotpattern/logstash:latest
mem_limit: 1g
restart: always
labels:
- triton.cns.services=logstash
ports:
# because the ports are chosen by the log_driver config
# these are fairly arbitrary but we're keeping them at
# the typical non-container values for familiarity
- "514" # syslog tcp port
- "514/udp" # syslog udp port
- "12201" # gelf
- "12201/udp" # gelf udp port
# - "24224" # fluentd tcp port
env_file: _env
environment:
- CONTAINERPILOT=file:///etc/containerpilot.json
command: >
/usr/local/bin/containerpilot
/opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf
# ---------------------------------------------------
# This common service definition is the default for nodes that both store
# data and act as potential masternodes. It also serves as a template for
# master-only and data-only ES nodes.
elasticsearch:
image: autopilotpattern/elasticsearch:latest
mem_limit: 4g
restart: always
labels:
- triton.cns.services=elasticsearch-master
env_file: _env
environment:
- ES_SERVICE_NAME=elasticsearch-master
- CLUSTER_NAME=elasticsearch
- ES_HEAP_SIZE=1g # set to 50% of mem_limit, but no more than 31g
- ES_NODE_MASTER=true # default
- ES_NODE_DATA=true # default
- CONTAINERPILOT=file:///etc/containerpilot.json
# set the number of threads we want based on the number of CPU shares
# that we'll get for this size container on Triton
- ES_JAVA_OPTS=-XX:-UseGCTaskAffinity -XX:-BindGCTaskThreadsToCPUs -XX:ParallelGCThreads=1 -XX:ParallelCMSThreads=1
# ES_HEAP_NEWSIZE # optional override
# ES_DIRECT_SIZE # optional override
command: >
/usr/local/bin/containerpilot
/usr/share/elasticsearch/bin/elasticsearch
--default.path.conf=/etc/elasticsearch
# ---------------------------------------------------
# The master-only node serves as the coordinator of the cluster only
elasticsearch_master:
extends:
service: elasticsearch
labels:
- triton.cns.services=elasticsearch-master
environment:
- ES_SERVICE_NAME=elasticsearch-master
- ES_NODE_MASTER=true
- ES_NODE_DATA=false
# ---------------------------------------------------
# Data-only nodes never act as master nodes.
elasticsearch_data:
extends:
service: elasticsearch
labels:
- triton.cns.services=elasticsearch-data
environment:
- ES_SERVICE_NAME=elasticsearch-data
- ES_NODE_MASTER=false
- ES_NODE_DATA=true
# ---------------------------------------------------
# Consul as a service discovery tier
consul:
image: progrium/consul:latest
labels:
- triton.cns.services=consul
command: -server -bootstrap -ui-dir /ui
restart: always
mem_limit: 128m
ports:
- 8500
expose:
- 53
- 8300
- 8301
- 8302
- 8400
- 8500
dns:
- 127.0.0.1