X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=blobdiff_plain;f=elasticsearch%2Ffiles%2Felasticsearch.yml;h=4d212610dcc4c656779497e5fabb688326676623;hp=89a1c5ca69262d7827b592ea2bd64bc358f553ba;hb=3762da9211ecc8b0fcbb57df0ae996af9b76de57;hpb=465fa7abc58059ab93ea3052e7484b986f601c34;ds=sidebyside diff --git a/elasticsearch/files/elasticsearch.yml b/elasticsearch/files/elasticsearch.yml index 89a1c5c..4d21261 100644 --- a/elasticsearch/files/elasticsearch.yml +++ b/elasticsearch/files/elasticsearch.yml @@ -32,10 +32,8 @@ # multiple clusters on the same network, make sure you're using unique names. # # cluster.name: elasticsearch -{%- if server.clustername is defined %} - -cluster.name: {{ server.clustername }} - +{%- if server.get('cluster', {}).name is defined %} +cluster.name: {{ server.cluster.name }} {% endif %} #################################### Node ##################################### @@ -50,11 +48,11 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # # Allow this node to be eligible as a master node (enabled by default): # -# node.master: true +node.master: {{ server.get('master', True)|lower }} # # Allow this node to store data (enabled by default): # -# node.data: true +node.data: {{ server.get('data', True)|lower }} # You can exploit these settings to design advanced cluster topologies. # @@ -89,11 +87,18 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # is a simple key value pair, similar to node.key: value, here is an example: # # node.rack: rack314 +{%- if server.rack is defined %} +node.rack: {{ server.rack }} +{%- endif %} # By default, multiple nodes are allowed to start from the same installation location # to disable it, set the following: # node.max_local_storage_nodes: 1 +{%- if server.get('threadpool', {}).get('bulk', {}).queue_size is defined %} +# For bulk operations. Thread pool type is fixed with a size of # of available processors. +threadpool.bulk.queue_size: {{ server.threadpool.bulk.queue_size }} +{%- endif %} #################################### Index #################################### @@ -110,11 +115,11 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # Set the number of shards (splits) of an index (5 by default): # -# index.number_of_shards: 5 +index.number_of_shards: {{ server.get('index', {}).get('shards', 5) }} # Set the number of replicas (additional copies) of an index (1 by default): # -# index.number_of_replicas: 1 +index.number_of_replicas: {{ server.get('index', {}).get('replicas', 1) }} # Note, that for development on a local machine, with small indices, it usually # makes sense to "disable" the distributed features: @@ -153,6 +158,9 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # Path to directory where to store index data allocated for this node. # # path.data: /path/to/data +{%- if server.get('path', {}).data is defined %} +path.data = {{ server.path.data }} +{%- endif %} # # Can optionally include more than one location, causing data to be striped across # the locations (a la RAID 0) on a file level, favouring locations with most free @@ -167,6 +175,9 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # Path to log files: # # path.logs: /path/to/logs +{%- if server.get('path', {}).logs is defined %} +path.logs = {{ server.path.logs }} +{%- endif %} # Path to where plugins are installed: # @@ -188,6 +199,9 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # Set this property to true to lock the memory: # # bootstrap.mlockall: true +{%- if server.mlockall is defined %} +bootstrap.mlockall: {{ server.mlockall|lower }} +{%- endif %} # Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set # to the same value, and that the machine has enough memory to allocate @@ -204,21 +218,22 @@ node.name: {{ server.get('name', '${HOSTNAME}') }} # communication. (the range means that if the port is busy, it will automatically # try the next port). -# Set the bind address specifically (IPv4 or IPv6): -# -# -network.bind_host: {{ server.bind.address }} -http.port: {{ server.bind.port }} -http.enabled: true -# Set the address other nodes will use to communicate with this node. If not -# set, it is automatically derived. It must point to an actual IP address. -# -# network.publish_host: 192.168.0.1 - # Set both 'bind_host' and 'publish_host': # # network.host: 192.168.0.1 +{%- if server.get('bind', {}).address is defined %} +network.host: {{ server.bind.address }} +{%- endif %} + +# Set specifically the address other nodes will use to communicate with this +# node. If not set, it is automatically derived. It must point to an actual +# IP address. +{%- if server.publish_host is defined %} +network.publish_host: {{ server.publish_host }} +{%- endif %} + + # Set a custom port for the node to node communication (9300 by default): # # transport.tcp.port: 9300 @@ -230,14 +245,28 @@ http.enabled: true # Set a custom port to listen for HTTP traffic: # # http.port: 9200 +{%- if server.get('bind', {}).port is defined %} +http.port: {{ server.bind.port }} +{%- endif %} # Set a custom allowed content length: # # http.max_content_length: 100mb +# Enable or disable cross-origin resource sharing +{%- if server.get('cors', {}).enabled is defined %} +http.cors.enabled: {{ server.cors.enabled|lower }} +{%- endif %} + +# Which origins to allow. +{%- if server.get('cors', {}).allow_origin is defined %} +http.cors.allow-origin: {{ server.cors.allow_origin }} +{%- endif %} + # Disable HTTP completely: # # http.enabled: false +http.enabled: true ################################### Gateway ################################### @@ -261,17 +290,26 @@ http.enabled: true # Allow recovery process after N nodes in a cluster are up: # # gateway.recover_after_nodes: 1 +{%- if server.get('gateway', {}).recover_after_nodes is defined %} +gateway.recover_after_nodes: {{ server.gateway.recover_after_nodes }} +{%- endif %} # Set the timeout to initiate the recovery process, once the N nodes # from previous setting are up (accepts time value): # # gateway.recover_after_time: 5m +{%- if server.get('gateway', {}).recover_after_time is defined %} +gateway.recover_after_time: {{ server.gateway.recover_after_time }} +{%- endif %} # Set how many nodes are expected in this cluster. Once these N nodes # are up (and recover_after_nodes is met), begin recovery process immediately # (without waiting for recover_after_time to expire): # # gateway.expected_nodes: 2 +{%- if server.get('gateway', {}).expected_nodes is defined %} +gateway.expected_nodes: {{ server.gateway.expected_nodes }} +{%- endif %} ############################# Recovery Throttling ############################# @@ -309,7 +347,7 @@ http.enabled: true # operational within the cluster. Its recommended to set it to a higher value # than 1 when running more than 2 nodes in the cluster. # -# discovery.zen.minimum_master_nodes: 1 +discovery.zen.minimum_master_nodes: {{ server.get('cluster', {}).minimum_master_nodes|default(1) }} # Set the time to wait for ping responses from other nodes when discovering. # Set this option to a higher value on a slow or congested network @@ -326,12 +364,14 @@ http.enabled: true # # 1. Disable multicast discovery (enabled by default): # -# discovery.zen.ping.multicast.enabled: false +discovery.zen.ping.multicast.enabled: {{ server.get('cluster', {}).get('multicast', True)|lower }} # # 2. Configure an initial list of master nodes in the cluster # to perform discovery when new nodes (master or data) are started: # -# discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] +{%- if server.get('cluster', {}).members is defined %} +discovery.zen.ping.unicast.hosts: [{% for member in server.cluster.members %}"{{ member.host }}:{{ member.get('port', 9300) }}"{% if not loop.last %}, {% endif %}{% endfor %}] +{%- endif %} # EC2 discovery allows to use AWS EC2 API in order to perform discovery. #