Restart Elastic on addition of node.

This commit is contained in:
Mike Reeves
2020-12-07 14:09:41 -05:00
parent 94253e92a6
commit 8ea088c3fc
2 changed files with 5 additions and 6 deletions

View File

@@ -54,7 +54,8 @@ if [ $TYPE == 'evaltab' ] || [ $TYPE == 'standalonetab' ]; then
salt-call state.apply utility queue=True salt-call state.apply utility queue=True
fi fi
fi fi
#if [ $TYPE == 'nodestab' ]; then if [ $TYPE == 'nodestab' ]; then
salt-call state.apply elasticseach
# echo " nodetype: $NODETYPE" >> $local_salt_dir/pillar/data/$TYPE.sls # echo " nodetype: $NODETYPE" >> $local_salt_dir/pillar/data/$TYPE.sls
# echo " hotname: $HOTNAME" >> $local_salt_dir/pillar/data/$TYPE.sls # echo " hotname: $HOTNAME" >> $local_salt_dir/pillar/data/$TYPE.sls
#fi fi

View File

@@ -189,13 +189,11 @@ so-elasticsearch:
- user: elasticsearch - user: elasticsearch
- extra_hosts: - extra_hosts:
- {{ grains.host }}:{{ NODEIP }} - {{ grains.host }}:{{ NODEIP }}
{%- if ismanager %}
{%- if salt['pillar.get']('nodestab', {}) %} {%- if salt['pillar.get']('nodestab', {}) %}
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %} {%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
- {{ SN.split('_')|first }}:{{ SNDATA.ip }} - {{ SN.split('_')|first }}:{{ SNDATA.ip }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- endif %}
- environment: - environment:
- discovery.type=single-node - discovery.type=single-node
- ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }} - ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }}