mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
Merge pull request #2298 from Security-Onion-Solutions/escluster
Traditional ES Clustering Support
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
{%- 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', '') %}
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip') %}
|
||||
{%- set FEATURES = salt['pillar.get']('elastic:features', False) %}
|
||||
{%- set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
|
||||
{%- if TRUECLUSTER is sameas true %}
|
||||
{%- 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 FEATURES = salt['pillar.get']('elastic:features', False) %}
|
||||
cluster.name: "{{ ESCLUSTERNAME }}"
|
||||
network.host: 0.0.0.0
|
||||
|
||||
# minimum_master_nodes need to be explicitly set when bound on a public IP
|
||||
# set to 1 to allow single node clusters
|
||||
# Details: https://github.com/elastic/elasticsearch/pull/17288
|
||||
discovery.zen.minimum_master_nodes: 1
|
||||
#discovery.zen.minimum_master_nodes: 1
|
||||
# This is a test -- if this is here, then the volume is mounted correctly.
|
||||
path.logs: /var/log/elasticsearch
|
||||
action.destructive_requires_name: true
|
||||
@@ -37,11 +38,30 @@ cluster.routing.allocation.disk.watermark.flood_stage: 98%
|
||||
#xpack.security.http.ssl.client_authentication: none
|
||||
#xpack.security.authc:
|
||||
# anonymous:
|
||||
# username: anonymous_user
|
||||
# roles: superuser
|
||||
# authz_exception: true
|
||||
# username: anonymous_user
|
||||
# roles: superuser
|
||||
# authz_exception: true
|
||||
{%- endif %}
|
||||
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
||||
node.name: {{ ESCLUSTERNAME }}
|
||||
node.name: {{ grains.host }}
|
||||
script.max_compilations_rate: 1000/1m
|
||||
{%- if TRUECLUSTER is sameas true %}
|
||||
{%- if grains.role == 'so-manager' %}
|
||||
{%- if salt['pillar.get']('nodestab', {}) %}
|
||||
node.roles: [ master, data, remote_cluster_client ]
|
||||
discovery.seed_hosts:
|
||||
- {{ grains.master }}
|
||||
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
|
||||
- {{ SN.split('_')|first }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- else %}
|
||||
node.roles: [ data, ingest ]
|
||||
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
||||
discovery.seed_hosts:
|
||||
- {{ grains.master }}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if TRUECLUSTER is sameas false %}
|
||||
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
||||
{%- endif %}
|
||||
indices.query.bool.max_clause_count: 1500
|
||||
|
||||
@@ -21,22 +21,22 @@
|
||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||
{% set MANAGER = salt['grains.get']('master') %}
|
||||
{% set FEATURES = salt['pillar.get']('elastic:features', False) %}
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
{% set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
{% set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
|
||||
|
||||
|
||||
{%- if FEATURES is sameas true %}
|
||||
{% if FEATURES is sameas true %}
|
||||
{% set FEATUREZ = "-features" %}
|
||||
{% else %}
|
||||
{% set FEATUREZ = '' %}
|
||||
{% endif %}
|
||||
|
||||
{% if grains['role'] in ['so-eval','so-managersearch', 'so-manager', 'so-standalone', 'so-import'] %}
|
||||
{% set esclustername = salt['pillar.get']('manager:esclustername', '') %}
|
||||
{% set esheap = salt['pillar.get']('manager:esheap', '') %}
|
||||
{% set esclustername = salt['pillar.get']('manager:esclustername') %}
|
||||
{% set esheap = salt['pillar.get']('manager:esheap') %}
|
||||
{% set ismanager = True %}
|
||||
{% elif grains['role'] in ['so-node','so-heavynode'] %}
|
||||
{% set esclustername = salt['pillar.get']('elasticsearch:esclustername', '') %}
|
||||
{% set esheap = salt['pillar.get']('elasticsearch:esheap', '') %}
|
||||
{% set esclustername = salt['pillar.get']('elasticsearch:esclustername') %}
|
||||
{% set esheap = salt['pillar.get']('elasticsearch:esheap') %}
|
||||
{% set ismanager = False %}
|
||||
{% endif %}
|
||||
|
||||
@@ -188,16 +188,16 @@ so-elasticsearch:
|
||||
- name: so-elasticsearch
|
||||
- user: elasticsearch
|
||||
- extra_hosts:
|
||||
- {{ grains.host }}:{{ NODEIP }}
|
||||
{%- if ismanager %}
|
||||
{%- if salt['pillar.get']('nodestab', {}) %}
|
||||
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
|
||||
- {{ SN.split('_')|first }}:{{ SNDATA.ip }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
- "{{ grains.host }}:{{ NODEIP }}"
|
||||
{% if salt['pillar.get']('nodestab', {}) %}
|
||||
{% for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
|
||||
- "{{ SN.split('_')|first }}:{{ SNDATA.ip }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- environment:
|
||||
{% if TRUECLUSTER is sameas false or (TRUECLUSTER is sameas true and not salt['pillar.get']('nodestab', {})) %}
|
||||
- discovery.type=single-node
|
||||
{% endif %}
|
||||
- ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }}
|
||||
ulimits:
|
||||
- memlock=-1:-1
|
||||
|
||||
Reference in New Issue
Block a user