This document discusses running Elasticsearch clusters on Docker containers. It describes how Docker containers are more lightweight than virtual machines and have less overhead. It provides examples of running official Elasticsearch Docker images and customizing configurations. It also covers best practices for networking, storage, constraints, and high availability when running Elasticsearch on Docker.
1 of 77
More Related Content
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
1. Elasticsearch & Docker
Rafał Kuć – Sematext Group, Inc.
@kucrafal @sematext sematext.com
Running High Performance
Fault Tolerant
Elasticsearch Clusters On Docker
13. Containers vs Virtual Machines
Hardware
Host Operating System
Traditional Virtual Machine
14. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Traditional Virtual Machine
15. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Traditional Virtual Machine
16. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Libraries Libraries
Traditional Virtual Machine
17. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Libraries Libraries
Application 1 Application 2
Traditional Virtual Machine
18. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Libraries Libraries
Application 1 Application 2
Hardware
Host Operating System
Traditional Virtual MachineContainer
19. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Libraries Libraries
Application 1 Application 2
Hardware
Host Operating System
Docker Engine
Traditional Virtual MachineContainer
20. Containers vs Virtual Machines
Hardware
Host Operating System
Hypervisor
Guest OS Guest OS
Libraries Libraries
Application 1 Application 2
Hardware
Host Operating System
Docker Engine
Libraries Libraries
Application 1 Application 2
Traditional Virtual MachineContainer
38. Dealing With Network
$ docker run -d -p 9200:9200 -p 9300:9300 elasticsearch
$ docker run -d --link es1 elasticsearch
-Ddiscovery.zen.ping.unicast.hosts=es1
39. Dealing With Network
$ docker run -d -p 9200:9200 -p 9300:9300 elasticsearch
Add network.publish_host when building own container
$ docker run -d --link es1 elasticsearch
-Ddiscovery.zen.ping.unicast.hosts=es1
40. Dealing With Network
$ docker run -d -p 9200:9200 -p 9300:9300 elasticsearch
Add network.publish_host when building own container
Add discovery.zen.ping.unicast.hosts when building own
container
$ docker run -d --link es1 elasticsearch
-Ddiscovery.zen.ping.unicast.hosts=es1
41. Network - Good Practices
Separate network for Elasticsearch cluster
42. Network - Good Practices
Separate network for Elasticsearch cluster
Common host names for containers
$ docker run -d -h esnode1 elasticsearch
43. Network - Good Practices
Separate network for Elasticsearch cluster
Common host names for containers
$ docker run -d -h esnode1 elasticsearch
Expose only needed ports
44. Network - Good Practices
Separate network for Elasticsearch cluster
Common host names for containers
$ docker run -d -h esnode1 elasticsearch
Expose only needed ports
Elasticsearch data & client nodes point to masters only
47. Dealing With Storage
By default in /usr/share/elasticsearch/data
By default not persisted
$ docker run -d
-v /opt/elasticsearch/data:/usr/share/elasticsearch/data
elasticsearch
48. Dealing With Storage
$ docker run -d
-v /opt/elasticsearch/data:/usr/share/elasticsearch/data
elasticsearch
By default in /usr/share/elasticsearch/data
By default not persisted
Use data only Docker volumes
Permissions
50. Data Only Docker Volumes
Bypasses Union File System
Can be shared between containers
51. Data Only Docker Volumes
Bypasses Union File System
Can be shared between containers
Data volumes persist if the container itself is deleted
52. Data Only Docker Volumes
Bypasses Union File System
Can be shared between containers
Data volumes persist if the container itself is deleted
$ docker create -v /mnt/es/data:/usr/share/elasticsearch/data
--name esdata elasticsearch
Permissions
53. Data Only Docker Volumes
Bypasses Union File System
Can be shared between containers
Data volumes persist if the container itself is deleted
$ docker create -v /mnt/es/data:/usr/share/elasticsearch/data
--name esdata elasticsearch
$ docker run --volumes-from esdata elasticsearch
54. Highly Available Cluster
Master only
Master only
Master only
Data only
Data only
Data only
Data only
Data only
Data only
Client only
Client only
55. Highly Available Cluster
Master only
Master only
Master only
Data only
Data only
Data only
Data only
Data only
Data only
Client only
Client only
minimum_master_nodes = N/2 + 1
76. We Are Hiring !
Dig Search ?
Dig Analytics ?
Dig Big Data ?
Dig Performance ?
Dig Logging ?
Dig working with and in open – source ?
We’re hiring world – wide !
http://sematext.com/about/jobs.html
Problems with standard deployment like:
Resources not utilized
Need to provision machines before deployment
Differences between development, test, QA and production environments
Hard to scale automatically
Problems with standard deployment like:
Resources not utilized
Need to provision machines before deployment
Differences between development, test, QA and production environments
Hard to scale automatically
Problems with standard deployment like:
Resources not utilized
Need to provision machines before deployment
Differences between development, test, QA and production environments
Hard to scale automatically