Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-elk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hiep Nguyen
docker-elk
Commits
24b1e178
Unverified
Commit
24b1e178
authored
Mar 07, 2018
by
Jon Benson
Committed by
Antoine Cotten
Apr 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support basic Docker Swarm deployment
parent
e800ca8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
23 deletions
+108
-23
.travis.yml
.travis.yml
+42
-23
docker-compose.yml
docker-compose.yml
+1
-0
docker-stack.yml
docker-stack.yml
+65
-0
No files found.
.travis.yml
View file @
24b1e178
sudo
:
required
language
:
generic
language
:
minimal
services
:
docker
env
:
-
DOCKER_COMPOSE_VERSION=1.14.0
install
:
# Installing docker
-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
-
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
-
sudo apt-get update
-
sudo apt-get -y install docker-ce
# Installing docker-compose
-
sudo rm /usr/local/bin/docker-compose
-
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" > docker-compose
-
chmod +x docker-compose
-
sudo mv docker-compose /usr/local/bin
# Install Docker Compose
-
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o "$HOME/bin/docker-compose"
-
chmod +x "$HOME/bin/docker-compose"
-
docker-compose --version
before_script
:
# Check docker & docker-compose versions
-
docker --version
-
docker-compose --version
# Build images
-
docker-compose build
# Pull buildpack image (curl 7.52.0+)
-
docker pull buildpack-deps:artful-curl
-
shopt -s expand_aliases
-
alias curl='docker run --rm --net=host buildpack-deps:artful-curl curl'
script
:
-
docker-compose build
# Compose
-
docker-compose up -d
# Verifications
-
sleep 30
-
sleep 60
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:9200/'
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:5601/api/status'
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:9600/_node/pipelines/main?pretty'
-
echo 'dockerelk' | nc localhost 5000
-
sleep 2
-
curl -s -XPOST 'http://localhost:9200/_refresh'
-
curl -s 'http://localhost:9200/_count?q=message:dockerelk' | egrep '^{"count":1,'
-
curl -s 'http://localhost:9200/_search?q=message:dockerelk&pretty'
-
docker-compose ps
-
docker-compose logs
-
curl --retry 10 --retry-delay 5 -D- http://localhost:9200/
-
curl --retry 10 --retry-delay 5 -D- http://localhost:5601/api/status
-
docker-compose down -v
# Swarm
-
docker swarm init
-
docker stack deploy -c ./docker-stack.yml elk
-
sleep 60
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:9200/'
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:5601/api/status'
-
curl -s --retry 10 --retry-delay 5 --retry-connrefused -D- 'http://localhost:9600/_node/pipelines/main?pretty'
-
echo 'dockerelk' | nc localhost 5000
-
sleep 2
-
curl -s -XPOST 'http://localhost:9200/_refresh'
-
curl -s 'http://localhost:9200/_count?q=message:dockerelk' | egrep '^{"count":1,'
-
curl -s 'http://localhost:9200/_search?q=message:dockerelk&pretty'
-
docker stack services elk
-
docker service logs elk_elasticsearch
-
docker service logs elk_kibana
-
docker service logs elk_logstash
docker-compose.yml
View file @
24b1e178
...
...
@@ -23,6 +23,7 @@ services:
-
./logstash/pipeline:/usr/share/logstash/pipeline:ro
ports
:
-
"
5000:5000"
-
"
9600:9600"
environment
:
LS_JAVA_OPTS
:
"
-Xmx256m
-Xms256m"
networks
:
...
...
docker-stack.yml
0 → 100644
View file @
24b1e178
version
:
'
3.3'
services
:
elasticsearch
:
image
:
docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
ports
:
-
"
9200:9200"
-
"
9300:9300"
configs
:
-
source
:
elastic_config
target
:
/usr/share/elasticsearch/config/elasticsearch.yml
environment
:
ES_JAVA_OPTS
:
"
-Xmx256m
-Xms256m"
networks
:
-
elk
deploy
:
mode
:
replicated
replicas
:
1
logstash
:
image
:
docker.elastic.co/logstash/logstash-oss:6.2.2
ports
:
-
"
5000:5000"
-
"
9600:9600"
configs
:
-
source
:
logstash_config
target
:
/usr/share/logstash/config/logstash.yml
-
source
:
logstash_pipeline
target
:
/usr/share/logstash/pipeline/logstash.conf
environment
:
LS_JAVA_OPTS
:
"
-Xmx256m
-Xms256m"
networks
:
-
elk
deploy
:
mode
:
replicated
replicas
:
1
kibana
:
image
:
docker.elastic.co/kibana/kibana-oss:6.2.2
ports
:
-
"
5601:5601"
configs
:
-
source
:
kibana_config
target
:
/usr/share/kibana/config/kibana.yml
networks
:
-
elk
deploy
:
mode
:
replicated
replicas
:
1
configs
:
elastic_config
:
file
:
./elasticsearch/config/elasticsearch.yml
logstash_config
:
file
:
./logstash/config/logstash.yml
logstash_pipeline
:
file
:
./logstash/pipeline/logstash.conf
kibana_config
:
file
:
./kibana/config/kibana.yml
networks
:
elk
:
driver
:
overlay
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment