Guest User

Untitled

a guest
Feb 13th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. root@ubuntu:~/stack-docker# cat docker-compose.yml
  2. version: '3'
  3. services:
  4. elasticsearch:
  5. image: docker.elastic.co/elasticsearch/elasticsearch-platinum:${TAG}
  6. container_name: elasticsearch
  7. network_mode: host
  8. environment:
  9. - bootstrap.memory_lock=true
  10. - ELASTIC_PASSWORD=Oracle9ias12
  11. - discovery.type=single-node
  12. - "ES_JAVA_OPTS=Xms2g -Xmx2g"
  13. - xpack.security.enabled=true
  14. - cluster.routing.allocation.disk.threshold_enabled=false
  15. ports:
  16. - 9200:9200
  17.  
  18. kibana:
  19. image: docker.elastic.co/kibana/kibana:${TAG}
  20. container_name: kibana
  21. environment:
  22. - ELASTICSEARCH_USERNAME=kibana
  23. - ELASTICSEARCH_PASSWORD=${ELASTIC_PASSWORD}
  24. network_mode: host
  25. ports:
  26. - 5601:5601
  27. depends_on:
  28. - elasticsearch
  29.  
  30. logstash:
  31. image: docker.elastic.co/logstash/logstash:${TAG}
  32. container_name: logstash
  33. network_mode: host
  34. environment:
  35. - 'xpack.monitoring.elasticsearch.password=${ELASTIC_PASSWORD}'
  36. # Provide a simple pipeline configuration for Logstash with a bind-mounted file.
  37. volumes:
  38. - ./config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
  39. depends_on: ['elasticsearch', 'setup_logstash']
  40.  
  41. auditbeat:
  42. image: docker.elastic.co/beats/auditbeat:${TAG}
  43. container_name: auditbeat
  44. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  45. cap_add: ['AUDIT_CONTROL', 'AUDIT_READ']
  46. # Auditbeat must run in the main process namespace.
  47. pid: host
  48. network_mode: host
  49. depends_on: ['elasticsearch']
  50.  
  51. filebeat:
  52. image: docker.elastic.co/beats/filebeat:${TAG}
  53. container_name: filebeat
  54. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  55. # If the host system has logs at "/var/log", mount them at "/mnt/log"
  56. # inside the container, where Filebeat can find them.
  57. # volumes: ['/var/log:/mnt/log:ro']
  58. network_mode: host
  59. depends_on: ['elasticsearch', 'setup_filebeat']
  60.  
  61. heartbeat:
  62. image: docker.elastic.co/beats/heartbeat:${TAG}
  63. container_name: heartbeat
  64. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  65. network_mode: host
  66. depends_on: ['elasticsearch', 'setup_heartbeat']
  67.  
  68. metricbeat:
  69. image: docker.elastic.co/beats/metricbeat:${TAG}
  70. container_name: metricbeat
  71. # The commented sections below enable Metricbeat to monitor the Docker host,
  72. # rather than the Metricbeat container. It's problematic with Docker for
  73. # Windows, however, since "/proc", "/sys" etc. don't exist on Windows.
  74. # The same likely applies to OSX (needs testing).
  75. # volumes:
  76. # - /proc:/hostfs/proc:ro
  77. # - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
  78. # - /:/hostfs:ro
  79. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}' # -system.hostfs=/hostfs
  80. network_mode: host
  81. depends_on: ['elasticsearch', 'setup_metricbeat']
  82.  
  83. packetbeat:
  84. image: docker.elastic.co/beats/packetbeat:${TAG}
  85. container_name: packetbeat
  86. # Packetbeat needs some elevated privileges to capture network traffic.
  87. # We'll grant them with POSIX capabilities.
  88. cap_add: ['NET_RAW', 'NET_ADMIN']
  89. # Use "host mode" networking to allow Packetbeat to capture traffic from
  90. # the real network interface on the host, rather than being isolated to the
  91. # container's virtual interface.
  92. network_mode: host
  93. # Since we did that, Packetbeat is not part of the "stack" Docker network
  94. # that the other containers are connected to, and thus can't resolve the
  95. # hostname "elasticsearch". Instead, we'll tell it to find Elasticsearch
  96. # on "localhost", which is the Docker host machine in this context.
  97. command: -e -E 'output.elasticsearch.hosts=["localhost:9200"]' -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  98. depends_on: ['elasticsearch']
  99.  
  100. apm_server:
  101. image: docker.elastic.co/apm/apm-server:${TAG}
  102. container_name: apm_server
  103. ports: ['100.98.26.181:8200:8200']
  104. network_mode: host
  105. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  106. depends_on: ['elasticsearch','setup_apm_server']
  107.  
  108. # Run a short-lived container to set up Logstash.
  109. setup_logstash:
  110. image: centos:7
  111. container_name: setup_logstash
  112. volumes: ['./scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
  113. # The script may have CR/LF line endings if using Docker for Windows, so
  114. # make sure that they don't confuse Bash.
  115. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
  116. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  117. network_mode: host
  118. depends_on: ['elasticsearch']
  119.  
  120. setup_kibana:
  121. image: centos:7
  122. container_name: setup_kibana
  123. volumes: ['./scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
  124. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
  125. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  126. network_mode: host
  127. depends_on: ['elasticsearch']
  128.  
  129. setup_auditbeat:
  130. image: docker.elastic.co/beats/auditbeat:${TAG}
  131. container_name: setup_auditbeat
  132. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  133. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s auditbeat']
  134. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  135. network_mode: host
  136. depends_on: ['kibana']
  137.  
  138. setup_filebeat:
  139. image: docker.elastic.co/beats/filebeat:${TAG}
  140. container_name: setup_filebeat
  141. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  142. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s filebeat']
  143. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  144. network_mode: host
  145. depends_on: ['kibana']
  146.  
  147. setup_heartbeat:
  148. image: docker.elastic.co/beats/heartbeat:${TAG}
  149. container_name: setup_heartbeat
  150. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  151. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s heartbeat']
  152. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  153. network_mode: host
  154. depends_on: ['kibana']
  155.  
  156. setup_metricbeat:
  157. image: docker.elastic.co/beats/metricbeat:${TAG}
  158. container_name: setup_metricbeat
  159. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  160. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s metricbeat']
  161. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  162. network_mode: host
  163. depends_on: ['kibana']
  164.  
  165. setup_packetbeat:
  166. image: docker.elastic.co/beats/packetbeat:${TAG}
  167. container_name: setup_packetbeat
  168. cap_add: ['NET_RAW', 'NET_ADMIN']
  169. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  170. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s packetbeat']
  171. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  172. network_mode: host
  173. depends_on: ['kibana']
  174.  
  175. setup_apm_server:
  176. image: docker.elastic.co/apm/apm-server:${TAG}
  177. container_name: setup_apm_server
  178. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  179. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s apm-server']
  180. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  181. network_mode: host
  182. depends_on: ['elasticsearch','kibana']
Add Comment
Please, Sign In to add comment