Merge pull request #483 from daddz/elasticsearch-53-cluster

Add Elasticsearch 5.4.0 Cluster
This commit is contained in:
Raúl Sánchez 2017-05-11 16:06:20 +02:00 committed by GitHub
commit adc11b89ae
5 changed files with 305 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Elasticsearch Cluster
A scalable Elasticsearch cluster
WARN: To avoid vm.max_map_count errors you could set "Update host sysctl" to true. Then param vm.max_map_count will be update to 262144 if it's less in your hosts.

View File

@ -0,0 +1,131 @@
version: '2'
services:
es-master:
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: es-storage
{{- if eq .Values.UPDATE_SYSCTL "true" -}}
,es-sysctl
{{- end}}
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
environment:
- "cluster.name=${cluster_name}"
- "node.name=$${HOSTNAME}"
- "bootstrap.memory_lock=true"
- "xpack.security.enabled=false"
- "ES_JAVA_OPTS=-Xms${master_heap_size} -Xmx${master_heap_size}"
- "discovery.zen.ping.unicast.hosts=es-master"
- "discovery.zen.minimum_master_nodes=${minimum_master_nodes}"
- "node.master=true"
- "node.data=false"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
mem_limit: ${master_mem_limit}
mem_swappiness: 0
cap_add:
- IPC_LOCK
volumes_from:
- es-storage
es-data:
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: es-storage
{{- if eq .Values.UPDATE_SYSCTL "true" -}}
,es-sysctl
{{- end}}
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
environment:
- "cluster.name=${cluster_name}"
- "node.name=$${HOSTNAME}"
- "bootstrap.memory_lock=true"
- "xpack.security.enabled=false"
- "discovery.zen.ping.unicast.hosts=es-master"
- "ES_JAVA_OPTS=-Xms${data_heap_size} -Xmx${data_heap_size}"
- "node.master=false"
- "node.data=true"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
mem_limit: ${data_mem_limit}
mem_swappiness: 0
cap_add:
- IPC_LOCK
volumes_from:
- es-storage
depends_on:
- es-master
es-client:
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: es-storage
{{- if eq .Values.UPDATE_SYSCTL "true" -}}
,es-sysctl
{{- end}}
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
environment:
- "cluster.name=${cluster_name}"
- "node.name=$${HOSTNAME}"
- "bootstrap.memory_lock=true"
- "xpack.security.enabled=false"
- "discovery.zen.ping.unicast.hosts=es-master"
- "ES_JAVA_OPTS=-Xms${client_heap_size} -Xmx${client_heap_size}"
- "node.master=false"
- "node.data=false"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
mem_limit: ${client_mem_limit}
mem_swappiness: 0
cap_add:
- IPC_LOCK
volumes_from:
- es-storage
depends_on:
- es-master
es-storage:
labels:
io.rancher.container.start_once: true
network_mode: none
image: rawmind/alpine-volume:0.0.2-1
environment:
- SERVICE_UID=1000
- SERVICE_GID=1000
- SERVICE_VOLUME=/usr/share/elasticsearch/data
volumes:
- es-storage-volume:/usr/share/elasticsearch/data
{{- if eq .Values.UPDATE_SYSCTL "true" }}
es-sysctl:
labels:
io.rancher.container.start_once: true
network_mode: none
image: rawmind/alpine-sysctl:0.1
privileged: true
environment:
- "SYSCTL_KEY=vm.max_map_count"
- "SYSCTL_VALUE=262144"
{{- end}}
volumes:
es-storage-volume:
driver: local
per_container: true

View File

@ -0,0 +1,97 @@
.catalog:
name: Elasticsearch Cluster
version: 5.4.0-rancher1
description: Scalable Elasticsearch Cluster
questions:
- variable: "cluster_name"
type: "string"
required: true
label: "Cluster name"
description: "Name of the Elasticsearch Cluster"
default: "es-cluster"
- variable: "UPDATE_SYSCTL"
label: "Update host sysctl:"
description: |
Set true to avoid vm.max_map_count errors.
WARN: If set true, host param vm.max_map_count will be update to 262144.
default: false
required: true
type: enum
options:
- false
- true
- variable: "master_heap_size"
type: "string"
required: true
label: "Heap size (master nodes)"
description: "Heap size to be allocated for Java (mater nodes)"
default: "512m"
- variable: "master_mem_limit"
type: "int"
required: true
label: "Memory limit in byte (master nodes)"
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (master nodes)"
default: 1073741824
- variable: "data_heap_size"
type: "string"
required: true
label: "Heap size (data nodes)"
description: "Heap size to be allocated for Java (mater nodes)"
default: "512m"
- variable: "data_mem_limit"
type: "int"
required: true
label: "Memory limit in byte (data nodes)"
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (data nodes)"
default: 1073741824
- variable: "client_heap_size"
type: "string"
required: true
label: "Heap size (client nodes)"
description: "Heap size to be allocated for Java (mater nodes)"
default: "512m"
- variable: "client_mem_limit"
type: "int"
required: true
label: "Memory limit in byte (client nodes)"
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (client nodes)"
default: 1073741824
- variable: "minimum_master_nodes"
type: "int"
required: true
label: "# of minimum Master Nodes"
description: "Set the number of required master nodes to reach quorum. Sets initial scale to this value as well"
default: 3
- variable: "initial_data_nodes"
type: "int"
required: true
label: "# of initial data nodes"
description: "Set the initial number of data nodes"
default: 2
- variable: "initial_client_nodes"
type: "int"
required: true
label: "# of initial client nodes"
description: "Set the initial number of client nodes"
default: 1
es-master:
scale: ${minimum_master_nodes}
es-data:
scale: ${initial_data_nodes}
es-client:
scale: ${initial_client_nodes}

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 80 80" style="enable-background:new 0 0 80 80;" xml:space="preserve">
<style type="text/css">
.st0{clip-path:url(#SVGID_2_);fill:#F0BF1A;}
.st1{clip-path:url(#SVGID_4_);fill:#3EBEB0;}
.st2{clip-path:url(#SVGID_6_);fill:#07A5DE;}
.st3{clip-path:url(#SVGID_8_);fill:#231F20;}
.st4{fill:#D7A229;}
.st5{fill:#019B8F;}
.st6{fill:none;}
</style>
<g>
<g>
<g>
<g>
<g>
<defs>
<circle id="SVGID_1_" cx="40" cy="40" r="32"/>
</defs>
<clipPath id="SVGID_2_">
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
</clipPath>
<path class="st0" d="M53.7,26H10c-1.1,0-2-0.9-2-2V10c0-1.1,0.9-2,2-2h57c1.1,0,2,0.9,2,2v0.7C68.9,19.1,62.1,26,53.7,26z"/>
</g>
</g>
<g>
<g>
<defs>
<circle id="SVGID_3_" cx="40" cy="40" r="32"/>
</defs>
<clipPath id="SVGID_4_">
<use xlink:href="#SVGID_3_" style="overflow:visible;"/>
</clipPath>
<path class="st1" d="M69.1,72H8.2l0,0V54l0,0h45.7c8.4,0,15.2,6.8,15.2,15.2V72L69.1,72z"/>
</g>
</g>
<g>
<g>
<defs>
<circle id="SVGID_5_" cx="40" cy="40" r="32"/>
</defs>
<clipPath id="SVGID_6_">
<use xlink:href="#SVGID_5_" style="overflow:visible;"/>
</clipPath>
<path class="st2" d="M50.1,49H4.8V31h45.3c5,0,9,4,9,9l0,0C59.1,45,55,49,50.1,49z"/>
</g>
</g>
<g>
<g>
<defs>
<circle id="SVGID_7_" cx="40" cy="40" r="32"/>
</defs>
<clipPath id="SVGID_8_">
<use xlink:href="#SVGID_7_" style="overflow:visible;"/>
</clipPath>
<path class="st3" d="M36,31H6.4v18H36c0.7-2.7,1.1-5.7,1.1-9S36.7,33.7,36,31z"/>
</g>
</g>
</g>
<path class="st4" d="M23.9,12.3c-5.4,3.2-9.9,8-12.7,13.7h23.6C32.4,20.5,28.6,15.9,23.9,12.3z"/>
<path class="st5" d="M24.9,68.2c4.6-3.7,8.3-8.6,10.6-14.2H11.2C14.2,60,19,65,24.9,68.2z"/>
</g>
</g>
<rect class="st6" width="80" height="80"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,5 @@
name: Elasticsearch Cluster 5.4.0
description: |
Elasticsearch, you know for search!
version: 5.4.0-rancher1
category: ELK