The config folder of elasticsearch contains two configuration files: elasticsearch. yml and logging. yml, the first is the basic configuration file of ES, the second is the log configuration file, es also uses log4j to record logs, so logging. the settings in yml can be set in the general log4j configuration file. The following describes the configuration items in the elasticsearch. yml file.
Cluster. Name: elasticsearch
Configure the elasticsearch cluster name. elasticsearch automatically discovers elasticsearch instances under the same CIDR block. If multiple clusters exist under the same CIDR block, you can use this attribute to differentiate different clusters.
Node. Name: "Franz Kafka"
The node name is randomly specified as a namespace name. The node is saved in the name.txt file in the jar folder of es, and many interesting names are added by the author.
Node. Master: True
Specify whether the node is eligible to be elected as a node. The default value is true. elasticsearch sets the first machine in the cluster as the master by default. If the node fails, the master is re-elected.
Node. Data: True
Specifies whether the node stores index data. The default value is true.
Index. number_of_shards: 5
Set the number of default index partitions. The default value is 5.
Index. number_of_replicas: 1
Sets the number of default index copies. The default value is 1 copy.
Path. conf:/path/to/Conf
Set the storage path of the configuration file, which is the config folder under the es root directory by default.
Path. Data:/path/to/Data
Set the storage path of the index data. By default, it is the data folder under the es root directory. You can set multiple storage paths separated by commas (,). For example:
Path. Data:/path/to/data1,/path/to/data2
Path. Work:/path/to/work
Set the storage path of temporary files. The default path is the work folder under the es root directory.
Path. logs:/path/to/logs
Set the log file storage path. The default path is the logs folder under the es root directory.
Path. plugins:/path/to/plugins
Set the plugin storage path. The default directory is the plugins folder under the es root directory.
Bootstrap. mlockall: True
Set to true to lock the memory. When the JVM starts swapping, the es efficiency is reduced, so to ensure that it is not swap, you can set the es_min_mem and es_max_mem environment variables to the same value, and ensure that the machine has enough memory to allocate to es. At the same time, elasticsearch processes must be allowed to lock the memory. in Linux, you can run the 'ulimit-l unlimited' command.
Network. bind_host: 192.168.0.1
Set the bound IP address, which can be IPv4 or IPv6. The default value is 0.0.0.0.
Network. publish_host: 192.168.0.1
Set the IP address for interaction between other nodes and the node. If this parameter is not set, the system automatically determines that the value must be a real IP address.
Network. HOST: 192.168.0.1
This parameter is used to set the bind_host and publish_host parameters at the same time.
Transport. tcp. Port: 9300
Set the TCP port for interaction between nodes. The default value is 9300.
Transport. tcp. Compress: True
Sets whether to compress the data during TCP transmission. The default value is false.
HTTP. Port: 9200
Set the http port of the external service. The default value is 9200.
HTTP. max_content_length: 100 MB
Sets the maximum content size. The default value is 100 MB.
HTTP. Enabled: false
Whether to Use http to provide external services. The default value is true.
Gateway. Type: Local
Gateway type. The default value is local, which is the local file system. It can be set to local file system, distributed file system, hadoop HDFS, and Amazon S3 server, other File System settings will be detailed next time.
Gateway. recover_after_nodes: 1
Set data recovery when n nodes in the cluster are started. The default value is 1.
Gateway. recover_after_time: 5 m
Set the timeout time of the initialization data recovery process. The default value is 5 minutes.
Gateway. expected_nodes: 2
Set the number of nodes in the cluster. The default value is 2. Once the N nodes are started, the data will be restored immediately.
Cluster. Routing. allocation. node_initial_primaries_recoveries: 4
Number of concurrent recovery threads during data restoration initialization. The default value is 4.
Cluster. Routing. allocation. node_concurrent_recoveries: 2
Number of concurrent recovery threads when adding or deleting nodes or Server Load balancer. The default value is 4.
Indices. Recovery. max_size_per_sec: 0
Set the bandwidth in the data recovery time limit. For example, if the bandwidth is 100 MB, the default value is 0, which means no limit.
Indices. Recovery. concurrent_streams: 5
Set this parameter to limit the maximum number of concurrent streams opened when data is restored from other shards. The default value is 5.
Discovery. Zen. minimum_master_nodes: 1
Set this parameter to ensure that the nodes in the cluster know the other N master-qualified nodes. The default value is 1. For large clusters, you can set a larger value (2-4)
Discovery. Zen. Ping. Timeout: 3 S
Set the ping connection timeout time when other nodes are automatically found in the cluster. The default value is 3 seconds. For poor network environments, you can set a high value to prevent errors during automatic discovery.
Discovery. Zen. Ping. multicast. Enabled: false
Set whether to enable multicast discovery nodes. The default value is true.
Discovery. Zen. Ping. unicast. hosts: ["host1", "host2: Port", "host3 [portx-Porty]"]
Set the initial list of Master nodes in the cluster. You can use these nodes to automatically discover the nodes that are newly added to the cluster.
Below are some slow log parameter settings during Query
Index. Search. slowlog. Level: trace
Index. Search. slowlog. Threshold. query. Warn: 10 s
Index.search.slowlog.threshold.query.info: 5S
Index. Search. slowlog. Threshold. query. Debug: 2 S
Index. Search. slowlog. Threshold. query. Trace: 500 ms
Index. Search. slowlog. Threshold. Fetch. Warn: 1 s
Index.search.slowlog.threshold.fetch.info: 800 ms
Index. Search. slowlog. Threshold. Fetch. Debug: 500 ms
Index. Search. slowlog. Threshold. Fetch. Trace: 200 ms
From: http://blog.csdn.net/laigood12345/article/details/7421197