Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the distributed search elasticsearch configuration files

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you the "distributed search elasticsearch configuration files are what", the content is easy to understand, clear, hope to help you solve the doubt, the following let the editor lead you to study and learn "distributed search elasticsearch configuration files what are" this article.

There are two configuration files in the config folder of elasticsearch:

Elasticsearch.yml and

Logging.yml

The first is the basic configuration file of es, and the second is the log configuration file. Es also uses log4j to log, so the settings in logging.yml can be set according to the normal log4j configuration file. The following is mainly about what can be configured in the elasticsearch.yml file.

Cluster.name: elasticsearch

Configure the cluster name of es. By default, elasticsearch,es will automatically discover es under the same IP address range. If there are multiple clusters under the same IP address range, you can use this attribute to distinguish different clusters.

Node.name: "Franz Kafka"

Node name, which is randomly assigned by default to a name list, which is found in the name.txt file in the config folder in es's jar package, with many interesting names added by authors.

Node.master: true

Specify whether the node is eligible to be elected as node. The default is true,es. The default is that the first machine in the cluster is master. If this machine crashes, master will be re-elected.

Node.data: true

Specifies whether the node stores index data, which defaults to true.

Index.number_of_shards: 5

Set the default number of index shards, which defaults to 5.

Index.number_of_replicas: 1

Sets the default number of index copies, which defaults to 1 copy.

Path.conf: / path/to/conf

Sets the storage path for configuration files, which defaults to the config folder under the es root directory.

Path.data: / path/to/data

Set the storage path for index data. The default 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 for temporary files. The default is the work folder under the es root directory.

Path.logs: / path/to/logs

Set the storage path for log files. The default is the logs folder under the es root directory.

Path.plugins: / path/to/plugins

Set the storage path of the plug-in. The default is the plugins folder under the es root directory.

Bootstrap.mlockall: true

Set to true to lock the memory. Because es is less efficient when jvm starts swapping, 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 allocated to es. At the same time, the process of elasticsearch should be allowed to lock the memory. Under linux, you can use the command `ulimit-l unlocked ted`.

Network.bind_host: 192.168.0.1

Set the bound ip address, which can be ipv4 or ipv6. The default is 0.0.0.0.

Network.publish_host: 192.168.0.1

Set the ip address where other nodes interact with this node. If you do not set it, it will automatically determine that the value must be a real ip address.

Network.host: 192.168.0.1

This parameter is used to set both bind_host and publish_host parameters at the same time.

Transport.tcp.port: 9300

Set the tcp port for interaction between nodes. The default is 9300.

Transport.tcp.compress: true

Sets whether to compress the data transferred by tcp. The default is false, which is not compressed.

Http.port: 9200

Set the http port for external services. The default is 9200.

Http.max_content_length: 100mb

Sets the maximum capacity of content. Default is 100mb.

Http.enabled: false

Whether to use http protocol to provide services. Default is true. Enable.

Gateway.type: local

The type of gateway, the default is local, that is, the local file system, can be set to the local file system, distributed file system, hadoop's HDFS, and amazon's S3 server. The setting methods of other file systems will be described in detail next time.

Gateway.recover_after_nodes: 1

Set N nodes in the cluster to perform data recovery when starting up. The default is 1.

Gateway.recover_after_time: 5m

Sets the timeout for initializing the data recovery process, which defaults to 5 minutes.

Gateway.expected_nodes: 2

Set the number of nodes in this cluster. The default is 2. As soon as these N nodes are started, the data will be recovered immediately.

Cluster.routing.allocation.node_initial_primaries_recoveries: 4

When initializing data recovery, the number of concurrent recovery threads defaults to 4.

Cluster.routing.allocation.node_concurrent_recoveries: 2

The number of concurrent recovery threads when adding or deleting nodes or load balancers. The default is 4.

Indices.recovery.max_size_per_sec: 0

Set the limited bandwidth for data recovery. For example, if you enter 100mb, the default is 0, that is, there is no limit.

Indices.recovery.concurrent_streams: 5

Set this parameter to limit the maximum number of concurrent streams that can be opened at the same time when recovering data from other shards. The default is 5.

Discovery.zen.minimum_master_nodes: 1

Set this parameter to ensure that the nodes in the cluster know about the other N master qualified nodes. The default is 1, and for large clusters, you can set a larger value (2-4).

Discovery.zen.ping.timeout: 3s

Set the ping connection timeout when other nodes are automatically discovered in the cluster. The default is 3 seconds. For poor network environments, you can set a higher value to prevent errors during automatic discovery.

Discovery.zen.ping.multicast.enabled: false

Sets whether to turn on the multicast discovery node. The default is true.

Discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3 [portX-portY]"]

Set the initial list of master nodes in the cluster, which can be used to automatically discover new nodes to join the cluster.

Here are some slow log parameter settings for queries

Index.search.slowlog.level: TRACE

Index.search.slowlog.threshold.query.warn: 10s

Index.search.slowlog.threshold.query.info: 5s

Index.search.slowlog.threshold.query.debug: 2s

Index.search.slowlog.threshold.query.trace: 500ms

Index.search.slowlog.threshold.fetch.warn: 1s

Index.search.slowlog.threshold.fetch.info: 800ms

Index.search.slowlog.threshold.fetch.debug:500ms

Index.search.slowlog.threshold.fetch.trace: 200ms

The above is all the contents of the article "what are the distributed search elasticsearch configuration files?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report