Skip to content

Commit 544b13d

Browse files
committed
upgraded Elasticsearch to version 1.7.0 + misc clean-up
1 parent 4201201 commit 544b13d

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Dockerfile for ELK stack
2-
# Elasticsearch 1.6.0, Logstash 1.5.2, Kibana 4.1.1
2+
# Elasticsearch 1.7.0, Logstash 1.5.2, Kibana 4.1.1
33

44
# Build with:
55
# docker build . -t <repo-user>/elk
@@ -9,7 +9,7 @@
99

1010
FROM phusion/baseimage
1111
MAINTAINER Sebastien Pujadas http://pujadas.net
12-
ENV REFRESHED_AT 2015-04-30
12+
ENV REFRESHED_AT 2015-07-17
1313

1414
###############################################################################
1515
# INSTALLATION
@@ -21,7 +21,7 @@ RUN apt-get update -qq \
2121
&& apt-get install -qqy curl
2222

2323
RUN curl http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
24-
RUN echo deb http://packages.elasticsearch.org/elasticsearch/1.6/debian stable main > /etc/apt/sources.list.d/elasticsearch.list
24+
RUN echo deb http://packages.elasticsearch.org/elasticsearch/1.7/debian stable main > /etc/apt/sources.list.d/elasticsearch.list
2525

2626
RUN apt-get update -qq \
2727
&& apt-get install -qqy \
@@ -103,5 +103,6 @@ ADD ./start.sh /usr/local/bin/start.sh
103103
RUN chmod +x /usr/local/bin/start.sh
104104

105105
EXPOSE 5601 9200 9300 5000
106+
VOLUME /var/lib/elasticsearch
106107

107108
CMD [ "/usr/local/bin/start.sh" ]

README-short.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Collect, search and visualise log data with ELK (Elasticsearch 1.6.0, Logstash 1.5.2, Kibana 4.1.1).
1+
Collect, search and visualise log data with ELK (Elasticsearch 1.7.0, Logstash 1.5.2, Kibana 4.1.1).

README.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Elasticsearch, Logstash, Kibana (ELK) Docker image
22

3-
This Docker image provides a convenient centralised log server and log management web interface, by packaging [Elasticsearch](http://www.elasticsearch.org/) (version 1.6.0), [Logstash](http://logstash.net/) (version 1.5.2), and [Kibana](http://www.elasticsearch.org/overview/kibana/) (version 4.1.1), collectively known as ELK.
3+
This Docker image provides a convenient centralised log server and log management web interface, by packaging [Elasticsearch](http://www.elasticsearch.org/) (version 1.7.0), [Logstash](http://logstash.net/) (version 1.5.2), and [Kibana](http://www.elasticsearch.org/overview/kibana/) (version 4.1.1), collectively known as ELK.
44

55
### Contents ###
66

@@ -15,7 +15,7 @@ This Docker image provides a convenient centralised log server and log managemen
1515
- [Installing Elasticsearch plugins](#installing-elasticsearch-plugins)
1616
- [Installing Logstash plugins](#installing-logstash-plugins)
1717
- [Starting Logstash's web interface](#starting-logstash-web)
18-
- [Making log data persistent](#persistent-log-data)
18+
- [Storing log data](#storing-log-data)
1919
- [Security considerations](#security-considerations)
2020
- [References](#references)
2121
- [About](#about)
@@ -28,9 +28,9 @@ To pull this image from the [Docker registry](https://registry.hub.docker.com/u/
2828

2929
$ sudo docker pull sebp/elk
3030

31-
**Note** – This image has been built automatically from the source files in the [source Git repository on GitHub](https://github.com/spujadas/elk-docker). If you want to build the image yourself, see the [Building the image](#building-image) section below.
31+
**Note** – This image has been built automatically from the source files in the [source Git repository on GitHub](https://github.com/spujadas/elk-docker). If you want to build the image yourself, see the *[Building the image](#building-image)* section below.
3232

33-
**Note** – The size of the virtual image (as reported by `docker images`) is 1,076 MB.
33+
**Note** – The size of the virtual image (as reported by `docker images`) is 1,091 MB.
3434

3535
## Usage <a name="usage"></a>
3636

@@ -111,11 +111,11 @@ Open a shell prompt in the container and type (replacing `<container-name>` with
111111

112112
- At the container's shell prompt, type `start.sh&` to start Elasticsearch, Logstash and Kibana in the background, and wait for everything to be up and running (wait for `{"@timestamp":... ,"message":"Listening on 0.0.0.0:5601",...}`)
113113

114-
Wait for Logstash to start (as indicated by the message `Logstash startup completed`), then enter:
114+
At the prompt, enter:
115115

116116
# /opt/logstash/bin/logstash -e 'input { stdin { } } output { elasticsearch { host => localhost } }'
117117

118-
Type some dummy text followed by Enter to create a log entry:
118+
Wait for Logstash to start (as indicated by the message `Logstash startup completed`), then type some dummy text followed by Enter to create a log entry:
119119

120120
this is a dummy entry
121121

@@ -144,7 +144,7 @@ Make sure that the drop-down "Time-field name" field is pre-populated with the v
144144

145145
Forwarding logs from a host relies on a Logstash forwarder agent that collects logs (e.g. from log files, from the syslog daemon) and sends them to our instance of Logstash.
146146

147-
Install [Logstash forwarder](https://github.com/elasticsearch/logstash-forwarder) on the host you want to collect and forward logs from (see the *[References](#References)* section below for links to detailed instructions).
147+
Install [Logstash forwarder](https://github.com/elasticsearch/logstash-forwarder) on the host you want to collect and forward logs from (see the *[References](#references)* section below for links to detailed instructions).
148148

149149
Here is a sample configuration file for Logstash forwarder, that forwards syslog and authentication logs, as well as [nginx](http://nginx.org/) logs.
150150

@@ -288,9 +288,11 @@ To do that:
288288
4. Start the image with port 9292 published (e.g. `docker run ... -p 9292:9292 ...`).
289289

290290

291-
## Making log data persistent <a name="persistent-log-data"></a>
291+
## Storing log data <a name="storing-log-data"></a>
292292

293-
If you want your ELK stack to keep your log data across container restarts, you need to create a Docker data volume inside the ELK container at `/var/lib/elasticsearch`, which is the directory that Elasticsearch stores its data in.
293+
In order to keep log data across container restarts, this image mounts `/var/lib/elasticsearch` — which is the directory that Elasticsearch stores its data in — as a volume.
294+
295+
You may however want to use a dedicated data volume to store this log data, for instance to facilitate back-up and restore operations.
294296

295297
One way to do this with the `docker` command-line tool is to first create a named container called `elk_data` with a bound Docker volume by using the `-v` option:
296298

@@ -300,13 +302,6 @@ You can now reuse the persistent volume from that container using the `--volumes
300302

301303
$ sudo docker run -p 5601:5601 -p 9200:9200 -p 5000:5000 --volumes-from elk_data --name elk sebp/elk
302304

303-
Alternatively, if you're using Compose, then simply add the two following lines to your `docker-compose.yml` file, under the `elk:` entry:
304-
305-
volumes:
306-
- /var/lib/elasticsearch
307-
308-
Then start the container with `sudo docker-compose up` as usual.
309-
310305
**Note** – By design, Docker never deletes a volume automatically (e.g. when no longer used by any container). Whilst this avoids accidental data loss, it also means that things can become messy if you're not managing your volumes properly (i.e. using the `-v` option when removing containers with `docker rm` to also delete the volumes... bearing in mind that the actual volume won't be deleted as long as at least one container is still referencing it, even if it's not running). As of this writing, managing Docker volumes can be a bit of a headache, so you might want to have a look at [docker-cleanup-volumes](https://github.com/chadoe/docker-cleanup-volumes), a shell script that deletes unused Docker volumes.
311306

312307
See Docker's page on [Managing Data in Containers](https://docs.docker.com/userguide/dockervolumes/) and Container42's [Docker In-depth: Volumes](http://container42.com/2014/11/03/docker-indepth-volumes/) page for more information on managing data volumes.

0 commit comments

Comments
 (0)