Skip to content

Commit

Permalink
Merge branch 'Bg-Tek-update-569' into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
spujadas committed May 2, 2018
2 parents 15f83a7 + 5925c08 commit c35f42c
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 13 deletions.
9 changes: 5 additions & 4 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.8
# Elasticsearch, Logstash, Kibana 5.6.9

# 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.8
ENV ELK_VERSION 5.6.9

### install Elasticsearch

Expand All @@ -49,15 +49,16 @@ ENV ES_PACKAGE elasticsearch-${ES_VERSION}.tar.gz
ENV ES_GID 991
ENV ES_UID 991
ENV ES_PATH_CONF /etc/elasticsearch
ENV ES_PATH_BACKUP /var/backups

RUN mkdir ${ES_HOME} \
&& curl -O https://artifacts.elastic.co/downloads/elasticsearch/${ES_PACKAGE} \
&& tar xzf ${ES_PACKAGE} -C ${ES_HOME} --strip-components=1 \
&& rm -f ${ES_PACKAGE} \
&& groupadd -r elasticsearch -g ${ES_GID} \
&& useradd -r -s /usr/sbin/nologin -M -c "Elasticsearch service user" -u ${ES_UID} -g elasticsearch elasticsearch \
&& mkdir -p /var/log/elasticsearch ${ES_PATH_CONF} ${ES_PATH_CONF}/scripts /var/lib/elasticsearch \
&& chown -R elasticsearch:elasticsearch ${ES_HOME} /var/log/elasticsearch /var/lib/elasticsearch ${ES_PATH_CONF}
&& mkdir -p /var/log/elasticsearch ${ES_PATH_CONF} ${ES_PATH_CONF}/scripts /var/lib/elasticsearch ${ES_PATH_BACKUP} \
&& chown -R elasticsearch:elasticsearch ${ES_HOME} /var/log/elasticsearch /var/lib/elasticsearch ${ES_PATH_CONF} ${ES_PATH_BACKUP}

ADD ./elasticsearch-init /etc/init.d/elasticsearch
RUN sed -i -e 's#^ES_HOME=$#ES_HOME='$ES_HOME'#' /etc/init.d/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.8, Logstash 5.6.8, Kibana 5.6.8).
Collect, search and visualise log data with ELK (Elasticsearch 5.6.9, Logstash 5.6.9, Kibana 5.6.9).
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ This image is hosted on Docker Hub at [https://hub.docker.com/r/sebp/elk/](https

The following tags are available:

- `latest`, `622`: ELK 6.2.2.
- `latest`, `623`: ELK 6.2.3.

- `622`: ELK 6.2.2.

- `621`: ELK 6.2.1.

Expand All @@ -32,6 +34,8 @@ The following tags are available:

- `600`: ELK 6.0.0.

- `569`: ELK 5.6.9.

- `568`: ELK 5.6.8.

- `564`: ELK 5.6.4.
Expand Down
15 changes: 14 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This web page documents how to use the [sebp/elk](https://hub.docker.com/r/sebp/
- [Installing Logstash plugins](#installing-logstash-plugins)
- [Installing Kibana plugins](#installing-kibana-plugins)
- [Persisting log data](#persisting-log-data)
- [Snapshot and restore](#snapshot-restore)
- [Setting up an Elasticsearch cluster](#elasticsearch-cluster)
- [Running Elasticsearch nodes on different hosts](#elasticsearch-cluster-different-hosts)
- [Running Elasticsearch nodes on a single host](#elasticsearch-cluster-single-host)
Expand Down Expand Up @@ -497,6 +498,12 @@ In terms of permissions, Elasticsearch data is created by the image's `elasticse

There is a [known situation](https://github.com/spujadas/elk-docker/issues/69) where SELinux denies access to the mounted volume when running in _enforcing_ mode. The workaround is to use the `setenforce 0` command to run SELinux in _permissive_ mode.

## Snapshot and restore <a name="snapshot-restore"></a>

The `/var/backups` directory is registered as the snapshot repository (using the `path.repo` parameter in the `elasticsearch.yml` configuration file). A volume or bind-mount could be used to access this directory and the snapshots from outside the container.

For further information on snapshot and restore operations, see the official documentation on [Snapshot and Restore](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html).

## Setting up an Elasticsearch cluster <a name="elasticsearch-cluster"></a>

The ELK image can be used to run an Elasticsearch cluster, either on [separate hosts](#elasticsearch-cluster-different-hosts) or (mainly for test purposes) on a [single host](#elasticsearch-cluster-single-host), as described below.
Expand Down Expand Up @@ -726,7 +733,7 @@ Attempting to start Filebeat without setting up the template produces the follow
"status" : 400
}

One can assume that in later releases of Filebeat the instructions will be clarified to specify how to manually load the index template into an specific instance of Elastisearch, and that the warning message will vanish as no longer applicable in version 6.
One can assume that in later releases of Filebeat the instructions will be clarified to specify how to manually load the index template into an specific instance of Elasticsearch, and that the warning message will vanish as no longer applicable in version 6.

## Troubleshooting <a name="troubleshooting"></a>

Expand Down Expand Up @@ -793,6 +800,12 @@ Bearing in mind that the first thing I'll need to do is reproduce your issue, pl

Here is the list of breaking changes that may have side effects when upgrading to later versions of the ELK image:

- **`path.repo`**

*Applies to tags: after `623` & `569`.*

Elasticsearch's `path.repo` parameter is predefined as `/var/backups` in `elasticsearch.yml` (see [Snapshot and restore](#snapshot-restore)).

- **Version 6**

*Applies to tags: `600` and later.*
Expand Down
4 changes: 4 additions & 0 deletions elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
#
#path.logs: /path/to/logs
#
# Path to snapshots for backups:
#
path.repo: /var/backups
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
Expand Down
4 changes: 2 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.8
# Filebeat 5.6.9

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

### install Filebeat

ENV FILEBEAT_VERSION 5.6.8
ENV FILEBEAT_VERSION 5.6.9

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.8"
ELK_VERSION = "5.6.9"
ELASTICSEARCH_VERSION = ELK_VERSION
LOGSTASH_VERSION = ELK_VERSION
KIBANA_VERSION = ELK_VERSION
Expand Down
10 changes: 7 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _term() {
exit 0
}

trap _term SIGTERM
trap _term SIGTERM SIGINT


## remove pidfiles in case previous graceful termination failed
Expand Down Expand Up @@ -100,7 +100,9 @@ else
ES_CONNECT_RETRY=30
fi

ELASTICSEARCH_URL=${ES_PROTOCOL:-http}://localhost:9200
if [ -z "$ELASTICSEARCH_URL" ]; then
ELASTICSEARCH_URL=${ES_PROTOCOL:-http}://localhost:9200
fi

counter=0
while [ ! "$(curl -k ${ELASTICSEARCH_URL} 2> /dev/null)" -a $counter -lt $ES_CONNECT_RETRY ]; do
Expand Down Expand Up @@ -198,7 +200,9 @@ if [ -x /usr/local/bin/elk-post-hooks.sh ]; then
KIBANA_CONNECT_RETRY=30
fi

KIBANA_URL=localhost:5601
if [ -z "$KIBANA_URL" ]; then
KIBANA_URL=http://localhost:5601
fi

counter=0
while [ ! "$(curl ${KIBANA_URL} 2> /dev/null)" -a $counter -lt $KIBANA_CONNECT_RETRY ]; do
Expand Down

0 comments on commit c35f42c

Please sign in to comment.