Skip to content

This project creates a single node ElasticSearch and Kibana instance secured by TLS with XPack using docker-compose.

Notifications You must be signed in to change notification settings

bradrushworth/elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ba84573 · Feb 9, 2021

History

4 Commits
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021

Repository files navigation

Docker Compose ElasticSearch/Kibana Tutorial

This project creates a single node ElasticSearch and Kibana instance secured by TLS with XPack using docker-compose.

Important Files

The environment variables are stored in the env file.

The demo ElasticSearch/Kibana passwords are stored in the passwords.txt file. These entries were generated by the elasticsearch-setup-passwords command.

Setup Process

Setup of host machine:

sudo apt update
sudo apt upgrade
sudo apt install docker.io
sudo usermod -aG docker ubuntu

You need to logout and log back in...

Test things are working:

docker run hello-world
df -h
sudo apt install docker-compose

If you need to use Docker swarm for some reason:

#docker swarm init

The vm.max_map_count kernel setting must be set to at least 262144 for production use:

sudo sysctl -w vm.max_map_count=262144

Add to /etc/sysctl.conf/etc/sysctl.conf to make permanent.

Increase ulimits for nofile and nproc:

docker run --rm centos:8 /bin/bash -c 'ulimit -Hn && ulimit -Sn && ulimit -Hu && ulimit -Su'

If required, adjust limits on docker run command by e.g. --ulimit nofile=65535:65535

Disable swapping on the host or do this instead:

"-e 'bootstrap.memory_lock=true' --ulimit memlock=-1:-1"

Optionally, build your custom images:

#docker build -t custom/mariadb mariadb --rm #--no-cache

Optionally, pull newer versions of public images:

#docker-compose pull

Create the TLS certificates for the ElasticSearch and Kibana:

docker-compose -f create-certs.yml run --rm create_certs

Create the ElasticSearch and Kibana containers:

docker-compose up -d #--force

To setup the system users automatically inside the container:

docker exec -it es01 bash
elasticsearch-setup-passwords auto
exit

Save these passwords to the passwords.txt file.

To execute bash inside the container:

docker exec -it es01  bash
docker exec -it kib01 bash

Tail the logs:

docker logs -f es01
docker logs -f kib01

The server is now available on:

References

About

This project creates a single node ElasticSearch and Kibana instance secured by TLS with XPack using docker-compose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages