ansible-role-opensearch/templates/opensearch.yml.j2

122 lines
4.0 KiB
Django/Jinja

# ======================== OpenSearch Configuration =========================
#
# NOTE: OpenSearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.opensearch.org
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: {{ opensearch_cluster_name }}
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: {{ ansible_fqdn }}
#
{% if not opensearch_single_node %}
cluster.initial_master_nodes:
{% for n in opensearch_bootstrap_known_masters %}
- {{ n }}
{% endfor %}
#
# Add custom attributes to the node:
#
# node.rack: r1
{% endif %}
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: {% for data_dir in opensearch_data_dirs %}{{ data_dir }}{% if not loop.last %},{% endif %}{% endfor %}
#
# Path to log files:
#
path.logs: {{ opensearch_log_dir }}
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# OpenSearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: {{ opensearch_bind_ip }}
#
# Set a custom port for HTTP:
#
http.port: {{ opensearch_http_port }}
# by default transport.host refers to network.host
transport.host: {{ opensearch_bind_ip }}
transport.tcp.port: {{ opensearch_transport_min_port }}-{{ opensearch_transport_max_port }}
#
# --------------------------------- Discovery ----------------------------------
#
{% if opensearch_single_node %}
discovery.type: single-node
{% else %}
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: {{ opensearch_discovery_host_list }}
#
{% if opensearch_define_majority_of_nodes %}
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: {{ opensearch_majority_of_nodes }}
#
#
{% if opensearch_real_cluster %}
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
gateway.recover_after_nodes: {{ opensearch_recover_after_nodes }}
#
{% endif %}
{% endif %}
{% endif %}
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
node.max_local_storage_nodes: {{ opensearch_max_local_storage_nodes }}
#
# Require explicit names when deleting indices:
#
action.destructive_requires_name: {{ opensearch_destructive_requires_name | lower }}
#
cluster.routing.allocation.disk.threshold_enabled: {{ opensearch_cluster_routing_allocation_disk_threshold_enabled }}
cluster.routing.allocation.disk.watermark.low: {{ opensearch_cluster_routing_allocation_disk_watermark_low }}
cluster.routing.allocation.disk.watermark.high: {{ opensearch_cluster_routing_allocation_disk_watermark_high }}
{% for conf in opensearch_additional_conf %}
{{ conf.name }}: {{ conf.value }}
{% endfor %}
{% if opensearch_disable_bootstrap_syscall_filter %}
# When using an old kernel
bootstrap.system_call_filter: false
{% endif %}