The configuration file is located in the%es_home%/config/elasticsearch.yml file, and you can configure it by opening it with EditPlus.
All configurations can use environment variables, for example: Node.rack: ${rack_env_var} Indicates that there is a Rack_env_var variable in the environment variable.
The following is a list of Elasticsearch configurable items:
1. Cluster name, default is Elasticsearch:cluster.name:elasticsearch
2. Node name, the node name is created automatically when ES starts, but you can also configure: node.name: "Franz Kafka"
3. Whether as the primary node, each node can be configured as the primary node, the default value is True:node.master:true
4. Whether the data is stored, that is, the index fragment is stored, the default value is True:node.data:true
The simultaneous configuration of master and data produces some bizarre effects:
1) When Master is false and data is true, the node is severely overloaded;
2) When Master is true and data is false, the node acts as a coordinator;
3) When Master is False,data also false, the node becomes a load balancer.
You can connect Http://localhost:9200/_cluster/health or Http://localhost:9200/_cluster/nodes
or use plug-in Http://github.com/lukas-vlcek/bigdesk or http://mobz.github.com/elasticsearch-head to view the cluster status.
5. Each node can define some common properties associated with it for filtering when a post-cluster is fragmented: node.rack:rack314
6. By default, multiple nodes can be started on the same installation path, if you want your ES to start only one node, you can set the following: Node.max_local_storage_nodes:1
7. Set the number of fragments for an index, the default value is 5:index.number_of_shards:5
8. Set the number of indexes that can be copied, the default value is 1:index.number_of_replicas:1
When you want to disable an advertisement, you can set the following:
Index.number_of_shards:1
index.number_of_replicas:0
The settings of these two properties directly affect the execution of indexes and search operations in the cluster. Assuming you have enough machines to hold fragments and replicas, you can set these two values as follows:
1) Having more fragments can improve the index execution capability and allow a large index to be distributed through the machine;
2) Having more replicators can improve the ability of search execution and clustering.
For an index, number_of_shards can only be set once, and Number_of_replicas may be incremented or reduced at any time using the index Update Settings API.
Elasticsearch focuses on load balancing, migration, clustering results from nodes, and more. You can try a variety of designs to accomplish these functions.
You can connect Http://localhost:9200/A/_status to detect the status of an index.
9. Where the configuration files are located, that is, the location of Elasticsearch.yml and logging.yml: path.conf:/path/to/conf
10. The index data assigned to the current node is located at: Path.data:/path/to/data
You can optionally include more than one location so that the data spans the file level so that there are more free paths at the time of creation, such as: Path.data:/path/to/data1,/path/to/data2
11. Temporary file location: path.work:/path/to/work
12. log file location: path.logs:/path/to/logs
13. Plug-in installation location: Path.plugins:/path/to/plugins
14. Plugin hosting location, if one of the plugins in the list is not installed, the node will not start: Plugin.mandatory:mapper-attachments,lang-groovy
When the JVM starts swapping, Elasticsearch does not perform well: you need to protect the JVM from swapping, and you can set Bootstrap.mlockall to True to disable swapping: Bootstrap.mlockall:true
Make sure that the values for the Es_min_mem and Es_max_mem are the same, and that you can allocate enough intrinsic to the elasticsearch and leave enough memory for the system operation.
16. By default, Elasticsearch uses 0.0.0.0 addresses and opens 9200-9300 ports for HTTP transmissions, 9300-9400 ports for node-to-node communication, and self-setting IP addresses: network.bind_host: 192.168.0.1
Publish_host set other nodes to connect to the address of this node, if not set, then automatically get, publish_host address must be the real address: network.publish_host:192.168.0.1
Bind_host and Publish_host can be set together: network.host:192.168.0.1
19. You can customize the port on which the node interacts with other nodes: transport.tcp.port:9300
20. When interacting between nodes, you can set whether to compress and convert to uncompressed: transport.tcp.compress:true
21. Custom port can be monitored for HTTP transport: http.port:9200
22. Set the maximum length of the content: HTTP.MAX_CONTENT_LENGTH:100MB
23. Prohibition of HTTP:http.enabled:false
24. The gateway allows the cluster state to be held after all cluster restarts, and changes to the cluster state will be preserved, and when the cluster is first enabled, it can be read from the gateway to the State, and the default gateways type (also recommended) is local:gateway.type:local
25. Allow recovery process after n nodes are started: gateway.recover_after_nodes:1
26. Set the time-out for initializing the recovery process: gateway.recover_after_time:5m
27. Set the maximum node that can exist in the cluster: Gateway.expected_nodes:2
28. Set the concurrent number of a node in two cases, one in the initial recovery process: cluster.routing.allocation.node_initial_primaries_recoveries:4
The other is when adding, deleting nodes and adjusting: cluster.routing.allocation.node_concurrent_recoveries:2
29. Set the throughput at recovery, which is unlimited by default: indices.recovery.max_size_per_sec:0
30. Set the maximum number of streams opened when recovering fragments from a peer node: indices.recovery.concurrent_streams:5
31. Set the number of primary nodes in a cluster, which can be between 2-4 when there are more than three nodes: Discovery.zen.minimum_master_nodes:1
32. Set the time-out when pinging other nodes, which can be larger when the network is slow: discovery.zen.ping.timeout:3s
There are more settings on http://elasticsearch.org/guide/reference/modules/discovery/zen.html on the discovery.
33. Prohibit the current node from discovering multiple cluster nodes, the default value is True:discovery.zen.ping.multicast.enabled:false
34. Set the list of master nodes that will be discovered when the new node is started: discovery.zen.ping.unicast.hosts: ["host1", "Host2:port", "Host3[portx-porty]"]
Distributed Search Elasticsearch cluster configuration