Skip to content

Commit

Permalink
Merge branch 'Bg-Tek-update-5615' into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
spujadas committed Mar 7, 2019
2 parents 3e0a6a1 + df80698 commit 829d761
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile for ELK stack
# Elasticsearch, Logstash, Kibana 5.6.13
# Elasticsearch, Logstash, Kibana 5.6.15

# Build with:
# docker build -t <repo-user>/elk .
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN set -x \
&& set +x


ENV ELK_VERSION 5.6.13
ENV ELK_VERSION 5.6.15

### install Elasticsearch

Expand Down
2 changes: 1 addition & 1 deletion README-short.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Collect, search and visualise log data with ELK (Elasticsearch 5.6.13, Logstash 5.6.13, Kibana 5.6.13).
Collect, search and visualise log data with ELK (Elasticsearch 5.6.15, Logstash 5.6.15, Kibana 5.6.15).
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ This image is hosted on Docker Hub at [https://hub.docker.com/r/sebp/elk/](https

The following tags are available:

- `latest`, `642`: ELK 6.4.2.
- `latest`, `661`: ELK 6.6.1.

- `660`: ELK 6.6.0.

- `651`: ELK 6.5.1.

- `650`: ELK 6.5.0.

- `643`: ELK 6.4.3.

- `642`: ELK 6.4.2.

- `641`: ELK 6.4.1.

Expand Down Expand Up @@ -48,6 +58,8 @@ The following tags are available:

- `600`: ELK 6.0.0.

- `5615`: ELK 5.6.15.

- `5613`: ELK 5.6.13.

- `5610`: ELK 5.6.10.
Expand Down
12 changes: 10 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ The following environment variables can be used to override the defaults used to

- `KIBANA_CONNECT_RETRY`: number of seconds to wait for Kibana to be up before running the post-hook script (see [Pre-hooks and post-hooks](#pre-post-hooks)) (default: `30`)

- `ES_HEAP_DISABLE` and `LS_HEAP_DISABLE`: disable `HeapDumpOnOutOfMemoryError` for Elasticsearch and Logstash respectively if non-zero (default: `HeapDumpOnOutOfMemoryError` is enabled).

Setting these environment variables avoids potentially large heap dumps if the services run out of memory.


As an illustration, the following command starts the stack, running Elasticsarch with a 2GB heap size and Logstash with a 1GB heap size:

Expand Down Expand Up @@ -627,7 +631,9 @@ To harden this image, at the very least you would want to:
- Password-protect the access to Kibana and Elasticsearch (see [SSL And Password Protection for Kibana](http://technosophos.com/2014/03/19/ssl-password-protection-for-kibana.html)).
- Generate a new self-signed authentication certificate for the Logstash input plugins (see [Notes on certificates](#certificates)) or (better) get a proper certificate from a commercial provider (known as a certificate authority), and keep the private key private.

The [sebp/elkx](https://hub.docker.com/r/sebp/elkx/) image, which extends the ELK image with X-Pack, may be a useful starting point to improve the security of the ELK services.
X-Pack, which is now bundled with the other ELK services, may be a useful to implement enterprise-grade security to the ELK stack.

Alternatively, to implement authentication in a simple way, a reverse proxy (e.g. as provided by [nginx](https://www.nginx.com/) or [Caddy](https://caddyserver.com/)) could be used in front of the ELK services.

If on the other hand you want to disable certificate-based server authentication (e.g. in a demo environment), see [Disabling SSL/TLS](#disabling-ssl-tls).

Expand Down Expand Up @@ -692,14 +698,16 @@ If the container stops and its logs include the message `max virtual memory area

### Elasticsearch is not starting (2): `cat: /var/log/elasticsearch/elasticsearch.log: No such file or directory` <a name="es-not-starting-not-enough-memory"></a>

If Elasticsearch's logs are *not* dumped (i.e. you get the following message: `cat: /var/log/elasticsearch/elasticsearch.log: No such file or directory`), then Elasticsearch did not have enough memory to start, see [Prerequisites](#prerequisites).
If Elasticsearch's logs are *not* dumped (i.e. you get the following message: `cat: /var/log/elasticsearch/elasticsearch.log: No such file or directory`), then Elasticsearch did not have enough memory to start, see [Prerequisites](#prerequisites).

### Elasticsearch is not starting (3): bootstrap tests <a name="es-not-starting-bootstrap-tests"></a>

**As from version 5**, if Elasticsearch is no longer starting, i.e. the `waiting for Elasticsearch to be up (xx/30)` counter goes up to 30 and the container exits with `Couln't start Elasticsearch. Exiting.` _and_ Elasticsearch's logs are dumped, then read the recommendations in the logs and consider that they *must* be applied.

In particular, in case (1) above, the message `max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]` means that the host's limits on mmap counts **must** be set to at least 262144.

Another example is `max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]`. In this case, the host's limits on open files (as displayed by `ulimit -n`) must be increased (see [File Descriptors](https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html) in Elasticsearch documentation); and Docker's `ulimit` settings must be adjusted, either for the container (using [`docker run`'s `--ulimit` option](https://docs.docker.com/engine/reference/commandline/run/#set-ulimits-in-container---ulimit) or [Docker Compose's `ulimits` configuration option](https://docs.docker.com/compose/compose-file/#ulimits)) or globally (e.g. in `/etc/sysconfig/docker`, add `OPTIONS="--default-ulimit nofile=1024:65536"`).

### Elasticsearch is suddenly stopping after having started properly <a name="es-suddenly-stopping"></a>

With the default image, this is usually due to Elasticsearch running out of memory after the other services are started, and the corresponding process being (silently) killed.
Expand Down
5 changes: 3 additions & 2 deletions nginx-filebeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile to illustrate how Filebeat can be used with nginx
# Filebeat 5.6.13
# Filebeat 5.6.15

# Build with:
# docker build -t filebeat-nginx-example .
Expand All @@ -19,7 +19,8 @@ ENV REFRESHED_AT 2016-11-04

### install Filebeat

ENV FILEBEAT_VERSION 5.6.13
ENV FILEBEAT_VERSION 5.6.15


RUN apt-get update -qq \
&& apt-get install -qqy curl \
Expand Down
2 changes: 1 addition & 1 deletion spec/Dockerfile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "docker"
require "serverspec"

ELK_VERSION = "5.6.13"
ELK_VERSION = "5.6.15"
ELASTICSEARCH_VERSION = ELK_VERSION
LOGSTASH_VERSION = ELK_VERSION
KIBANA_VERSION = ELK_VERSION
Expand Down
10 changes: 10 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ else
> ${ES_PATH_CONF}/jvm.options.new && mv ${ES_PATH_CONF}/jvm.options.new ${ES_PATH_CONF}/jvm.options
fi

if [ ! -z "$ES_HEAP_DISABLE" ]; then
awk -v LINE="#-XX:+HeapDumpOnOutOfMemoryError" '{ sub(/^-XX:\+HeapDumpOnOutOfMemoryError.*/, LINE); print; }' ${ES_PATH_CONF}/jvm.options \
> ${ES_PATH_CONF}/jvm.options.new && mv ${ES_PATH_CONF}/jvm.options.new ${ES_PATH_CONF}/jvm.options
fi

# override ES_JAVA_OPTS variable if set
if [ ! -z "$ES_JAVA_OPTS" ]; then
awk -v LINE="ES_JAVA_OPTS=\"$ES_JAVA_OPTS\"" '{ sub(/^#?ES_JAVA_OPTS=.*/, LINE); print; }' /etc/default/elasticsearch \
Expand Down Expand Up @@ -157,6 +162,11 @@ else
> ${LOGSTASH_PATH_SETTINGS}/jvm.options.new && mv ${LOGSTASH_PATH_SETTINGS}/jvm.options.new ${LOGSTASH_PATH_SETTINGS}/jvm.options
fi

if [ ! -z "$LS_HEAP_DISABLE" ]; then
awk -v LINE="#-XX:+HeapDumpOnOutOfMemoryError" '{ sub(/^-XX:\+HeapDumpOnOutOfMemoryError.*/, LINE); print; }' ${LOGSTASH_PATH_SETTINGS}/jvm.options \
> ${LOGSTASH_PATH_SETTINGS}/jvm.options.new && mv ${LOGSTASH_PATH_SETTINGS}/jvm.options.new ${LOGSTASH_PATH_SETTINGS}/jvm.options
fi

# override LS_OPTS variable if set
if [ ! -z "$LS_OPTS" ]; then
awk -v LINE="LS_OPTS=\"$LS_OPTS\"" '{ sub(/^LS_OPTS=.*/, LINE); print; }' /etc/init.d/logstash \
Expand Down

0 comments on commit 829d761

Please sign in to comment.