(To) distributed search elasticsearch -- Configuration

Source: Internet
Author: User

The configuration file is located in the % es_home %/config/elasticsearch. yml file. Open it with editplus and you can configure it.
Environment variables can be used for all configurations, for example:
Node. Rack :$ {rack_env_var}
Indicates that there is an rack_env_var variable in the environment variable.
The following describes the configuration items of elasticsearch:
1. Cluster name, elasticsearch by default:
Cluster. Name: elasticsearch
2. node name. The node name will be automatically created when elasticsearch starts, but you can also configure it:
Node. Name: "Franz Kafka"
3. Whether to act as the master node. Each node can be configured as the master node. The default value is true:
Node. Master: True
4. Whether to store data, that is, to store index fragments. The default value is true:
Node. Data: True
Configuring both the master and data results in some strange results:
1) when the master value is false and the data value is true, a severe load is generated on the node;
2) When the master value is true and the data value is false, the node acts as a coordinator;
3) when the master value is false and the data value is false, the node becomes a Load balancer.
You can connect to http: // localhost: 9200/_ cluster/health or http: // localhost: 9200/_ cluster/nodes, or use the plug-in plugin.
5. Each node can define some common attributes associated with it for filtering in later cluster fragment allocation:
Node. Rack: rack314
6. By default, multiple nodes can be started in the same installation path. If you want your elasticsearch to start only one node, perform the following settings:
Node. max_local_storage_nodes: 1
7. Set the number of shards for an index. The default value is 5:
Index. number_of_shards: 5
8. Set the number of indexes that can be replicated. The default value is 1:
Index. number_of_replicas: 1
When you want to disable the publication type, you can make the following settings:
Index. number_of_shards: 1
Index. number_of_replicas: 0
The setting of these two attributes directly affects the execution of index and search operations in the cluster. If you have enough machines to hold fragments and duplicates, you can set these two values according to the following rules:
1) having more fragments can improve index execution capabilities and allow distribution of a large index through machines;
2) more replicas can improve search execution and cluster capabilities.
For an index, number_of_shards can be set only once, while number_of_replicas can use the Index Update setting API to increase or decrease at any time.
Elasticsearch focuses on load balancing, migration, and cluster results from nodes. You can try multiple designs to complete these functions.
You can connect to http: // localhost: 9200/A/_ status to check the index status.
9. Location of the configuration file, that is, location of elasticsearch. yml and logging. yml:
Path. conf:/path/to/Conf
10. The location of the index data allocated to the current node:
Path. Data:/path/to/Data
You can choose to include more than one location, so that the data spans the file level, so that more free paths are available during creation, such:
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. Plug-in hosting location. If a plug-in the list is not installed, the node cannot be started:
Plugin. Mandatory: mapper-attachments, Lang-Groovy
15. When the JVM starts to switch, elasticsearch does not perform well: You need to ensure that the JVM does not switch. You can set Bootstrap. mlockall to true to disable switching:
Bootstrap. mlockall: True
Make sure that the values of es_min_mem and es_max_mem are the same, and elasticsearch can be allocated with sufficient internal memory and sufficient memory for system operations.
16. By default, elasticsearch uses the 0.0.0.0 address, enables port 9200-9300 for HTTP transmission, enables port 9300-9400 for node-to-node communication, or sets the IP Address:
Network. bind_host: 192.168.0.1
17. publish_host: Set the address of another node to connect to this node. If this parameter is not set, the address is automatically obtained. The address of publish_host must be a real address:
Network. publish_host: 192.168.0.1
18. 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. During interaction between nodes, you can set whether to compress or not to convert it to not compress:
Transport. tcp. Compress: True
21. You can customize the port for the HTTP transmission listener:
HTTP. Port: 9200
22. Set the maximum length of the content:
HTTP. max_content_length: 100 MB
23. Disable HTTP
HTTP. Enabled: false
24. the gateway allows you to hold the cluster status after all clusters are restarted. Changes to the cluster status are saved. When you enable the cluster for the first time, you can read the status from the gateway, the default gateway type (also recommended) is local:
Gateway. Type: Local
25. The restoration process can be performed after N nodes are started:
Gateway. recover_after_nodes: 1
26. Set the timeout value for the initialization recovery process:
Gateway. recover_after_time: 5 m
27. Set the maximum number of nodes in the Cluster:
Gateway. expected_nodes: 2
28. Set the number of concurrent jobs for a node. In either case, during the initial recovery:
Cluster. Routing. allocation. node_initial_primaries_recoveries: 4
In addition, when adding or deleting nodes and adjusting nodes:
Cluster. Routing. allocation. node_concurrent_recoveries: 2
29. Set the throughput during recovery. By default, the throughput is unlimited:
Indices. Recovery. max_size_per_sec: 0
30. Set the maximum number of streams opened when the fragments are restored from the peer node:
Indices. Recovery. concurrent_streams: 5
31. Set the number of master nodes in a cluster. When there are more than three nodes, the value can be between 2 and 4:
Discovery. Zen. minimum_master_nodes: 1
32. Set the timeout time when you ping other nodes. When the network is slow, you can set this value to a greater value:
Discovery. Zen. Ping. Timeout: 3 S
Bytes.
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 can be found when the new node is started:
Discovery. Zen. Ping. unicast. hosts: ["host1", "host2: Port", "host3 [portx-Porty]"]

(To) distributed search elasticsearch -- Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.