Skip to content

Commit 7045193

Browse files
committed
completed switch to docker-compose
1 parent 1316d56 commit 7045193

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed
29.5 MB
Binary file not shown.

start.sh

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,16 @@
11
#!/bin/bash
22

3-
ELK_VERSION="5.6.10"
43
NGINX_VERSION="1.15.2"
54

6-
# 1. First let's start Elasticsearch
5+
# 1. First let's start our ELK-Stack
6+
docker-compose up -d
77

8-
docker run -d --rm --name elasticsearch \
9-
elasticsearch:$ELK_VERSION
10-
11-
# 2. Now we can start logstash (host from config has to match link)
12-
13-
docker build -t mylogstash ./logstash
14-
15-
docker run -d --rm --name logstash \
16-
--link elasticsearch:elasticsearch \
17-
mylogstash
18-
19-
# 3. Let's run Kibana
20-
# If you want to check it out go to http://localhost:5601
21-
# Don't forget to create an Index pattern
22-
23-
docker run -d --rm --name kibana \
24-
--link elasticsearch:elasticsearch \
25-
-p 5601:5601 \
26-
kibana:$ELK_VERSION
27-
28-
# 4. Finally let's start our webserver
29-
# Note that logging can not be connected via Link
30-
# --> this will not work in a Docker-Compose File
31-
# Except $LOGSTASH_ADDRESS is defined as environment variable
32-
33-
LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
8+
# this could be exported to a environment variable
9+
LOGSTASH_ADDRESS=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginxelk_logstash_1)
3410

11+
# 2. Now let's start a test application
12+
# 2.1 try to query http://localhost and some wrong url's
13+
# 2.2 set up an index on http://localhost:5601
3514
docker run -d --rm --name nginx \
3615
--log-driver=gelf \
3716
--log-opt gelf-address=udp://$LOGSTASH_ADDRESS:12201 \

0 commit comments

Comments
 (0)