Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deploy Elastic Stack 5.2.0+ on swarm mode cluster, access container logs in elk.

License

NotificationsYou must be signed in to change notification settings

HackerWilson/docker-elk-deployment

Repository files navigation

Introduction

DeployElastic Stack 5.2.0+ onswarm mode cluster, access container logs in elk.

+------------+            +------------+            +------------+|  Dockerd   |            |  Dockerd   |            |  Dockerd   ||  GELF UDP  |            |  GELF UDP  |            |  GELF UDP  |+------------+            +------------+            +------------+      |                         |                         |+------------+            +------------+            +------------+|  Logstash  |            |  Logstash  |            |  Logstash  ||  Shipper   |            |  Shipper   |            |  Shipper   |+------------+            +------------+            +------------+      |                         |                         |      |                   +------------+                  |      |___________________|   Redis    |__________________|                          |   Broker   |                          +------------+                                |                          +------------+                          |  Logstash  |                          |  Indexer   |                          +------------+                                |                        +----------------+                        |  Elasticsearch |                        +----------------+                                |                          +------------+                          |   Kibana   |                          +------------+

Requirements

Usage

  • Add new environment files, eg.env_files/test

When deploy test example within this project, you only need to modifyELASTICSEARCH_DATA_PATH andREDIS_DATA_PATH these two variables inenv_files/test/common.env file.

  • Create the.env file used bydocker-compose
./env.sh test

Deploy elk stack

  • Create theelk stack compose file
docker-compose config > elk-stack.yml
  • Deployelk stack toswarm mode cluster
docker stack deploy -c elk-stack.yml $COMPOSE_PROJECT_NAME

Deploy logstash shipper

  • Create thelogstash shipper compose file
docker-compose -f logstash-shipper.yml config > elk-logstash-shipper.yml
  • Deploylogstash shipper to every node inswarm mode cluster
docker stack deploy -c elk-logstash-shipper.yml elk-logstash

Deployment test

  • Send some container logs tologstash shipper bygelf logging drivers
docker run --rm --log-driver gelf --log-opt gelf-address=udp://127.0.0.1:9500 -d alpine echo hello world
  • Browser toKibana pages
http://swarm-node-host:5601
  • Configure an index pattern withlogstash-* inKibana, then select the time range of today

Tips

sudo sysctl -w vm.max_map_count=262144
  • You can use other volume plugins by fork this project then modify thedriver anddriver_opts under the top-levelvolumes key

References

License

About

Deploy Elastic Stack 5.2.0+ on swarm mode cluster, access container logs in elk.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp