Create master node role in ES

This commit is contained in:
Mike Reeves
2020-10-28 16:44:14 -04:00
parent ecfd1bbe4d
commit 57d8f25422
2 changed files with 13 additions and 9 deletions

View File

@@ -1,11 +1,8 @@
{%- set NODE_ROUTE_TYPE = salt['pillar.get']('elasticsearch:node_route_type', 'hot') %} {%- set NODE_ROUTE_TYPE = salt['pillar.get']('elasticsearch:node_route_type', 'hot') %}
{%- if salt['pillar.get']('elasticsearch:hot_warm_enabled') or salt['pillar.get']('elasticsearch:true_cluster') %}
{%- set ESCLUSTERNAME = salt['pillar.get']('elasticsearch:true_cluster_name', '') %}
{%- else %}
{%- set ESCLUSTERNAME = salt['pillar.get']('elasticsearch:esclustername', '') %} {%- set ESCLUSTERNAME = salt['pillar.get']('elasticsearch:esclustername', '') %}
{%- endif %} {%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%} {%- set FEATURES = salt['pillar.get']('elastic:features', False) %}
{% set FEATURES = salt['pillar.get']('elastic:features', False) %} {%- set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
cluster.name: "{{ ESCLUSTERNAME }}" cluster.name: "{{ ESCLUSTERNAME }}"
network.host: 0.0.0.0 network.host: 0.0.0.0
@@ -44,7 +41,7 @@ cluster.routing.allocation.disk.watermark.flood_stage: 98%
node.attr.box_type: {{ NODE_ROUTE_TYPE }} node.attr.box_type: {{ NODE_ROUTE_TYPE }}
node.name: {{ grains.host }} node.name: {{ grains.host }}
script.max_compilations_rate: 1000/1m script.max_compilations_rate: 1000/1m
{%- if salt['pillar.get']('elasticsearch:true_cluster') %} {%- if TRUECLUSTER is sameas true %}
{%- if grains.role == 'so-manager' %} {%- if grains.role == 'so-manager' %}
node.roles: [ master ] node.roles: [ master ]
{%- endif %} {%- endif %}

View File

@@ -1331,8 +1331,15 @@ elasticsearch_pillar() {
"elasticsearch:"\ "elasticsearch:"\
" mainip: '$MAINIP'"\ " mainip: '$MAINIP'"\
" mainint: '$MNIC'"\ " mainint: '$MNIC'"\
" esheap: '$NODE_ES_HEAP_SIZE'"\ " esheap: '$NODE_ES_HEAP_SIZE'"
" esclustername: {{ grains.host }}"\ if [ -n "$ESCLUSTERNAME" ]; then
printf '%s\n'\
" esclustername: $ESCLUSTERNAME"
else
printf '%s\n'\
" esclustername: {{ grains.host }}"
fi
printf '%s\n'\
" node_type: '$NODETYPE'"\ " node_type: '$NODETYPE'"\
" es_port: $node_es_port"\ " es_port: $node_es_port"\
" log_size_limit: $log_size_limit"\ " log_size_limit: $log_size_limit"\