You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
4
5
5
### Contents ###
6
6
@@ -15,7 +15,7 @@ This Docker image provides a convenient centralised log server and log managemen
@@ -28,9 +28,9 @@ To pull this image from the [Docker registry](https://registry.hub.docker.com/u/
28
28
29
29
$ sudo docker pull sebp/elk
30
30
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.
32
32
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.
34
34
35
35
## Usage <aname="usage"></a>
36
36
@@ -111,11 +111,11 @@ Open a shell prompt in the container and type (replacing `<container-name>` with
111
111
112
112
- 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",...}`)
113
113
114
-
Wait for Logstash to start (as indicated by the message `Logstash startup completed`), then enter:
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:
119
119
120
120
this is a dummy entry
121
121
@@ -144,7 +144,7 @@ Make sure that the drop-down "Time-field name" field is pre-populated with the v
144
144
145
145
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.
146
146
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).
148
148
149
149
Here is a sample configuration file for Logstash forwarder, that forwards syslog and authentication logs, as well as [nginx](http://nginx.org/) logs.
150
150
@@ -288,9 +288,11 @@ To do that:
288
288
4. Start the image with port 9292 published (e.g. `docker run ... -p 9292:9292 ...`).
289
289
290
290
291
-
## Making log data persistent <aname="persistent-log-data"></a>
291
+
## Storing log data <aname="storing-log-data"></a>
292
292
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.
294
296
295
297
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:
296
298
@@ -300,13 +302,6 @@ You can now reuse the persistent volume from that container using the `--volumes
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
-
310
305
**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.
311
306
312
307
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