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

Introduction to important configuration of Elasticsearch5.4 configuration file

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

Share

Shulou(Shulou.com)06/03 Report--

#-- Cluster-- # configure the cluster name of es. By default, elasticsearch,es will automatically discover es under the same network segment. If there are multiple clusters under the same network segment, You can use this attribute to distinguish between different clusters. Cluster.name: elasticsearch#-- Node-- # Node name node.name:es01#node.master node.data description # true true default node, which can be master Can also store data # false true nodes will never become master, can only save data, the main force of this cluster # true false this node is only used as the primary node: no data is stored and resources are available. This will be the coordinator of your cluster # false false becomes client node, which acts as a search load balancer (getting data from nodes, aggregate results, etc.) is equivalent to adding memory to the cluster node.master: truenode.data: true#Ingest Node (extract nodes): can perform preprocessing pipes, have their own independent tasks to perform, similar to logstash functions Not responsible for data and cluster-related transactions # if you don't want this setting, you can change the configuration file to: node.ingest: false# it is generally recommended to disable it on master node and data node to prevent problems and protect the cluster. And client node is the best candidate node.ingest: false#Tribe Node (tribal node): coordinate the node between the cluster and the cluster, this tribal node supports cross-cluster search, and # Coordinating Node (coordinating node) will be deleted in pop search 7.0: each node is a potential coordinating node and cannot be disabled. The most important function of the orchestrating node is to gather the data from each shard and return it to the client # so the ES node needs to have enough CPU and memory to handle the gather phase of the coordinating node. # set the default number of index shards, which defaults to 5. The number of shards is preferably a multiple of the number of nodes, preferably no more than three times # index.number_of_shards: 5 this setting after 5.0 does not need # node settings must not contain any index level settings#Since elasticsearch 5.x index level settings can NOT be set on the nodes # configuration like the elasticsearch.yaml. In system properties or command line # arguments.# sets the default number of index copies, which defaults to 1 copy. Replicas are used to cope with rising throughput and to ensure data security and query efficiency # index.number_of_replicas: 1 this setting is not necessary after 5.0. note: the above two parameters need to be allocated reasonably. Once the index is created, shards (number of shards) cannot be changed unless the index is rebuilt. # MAX shard number: Max number of nodes = Number of shards * (number of replicas + 1); if you plan to use 10 shards and 2 shard copies, then the maximum number of shards is 30. The more Max shards, the faster the query. Each shard is an independent Lucene index, and more shards represent operations in a smaller index. # the number of fragments (shard) determines the efficiency of the write operation, and the number of MAX fragments determines the read operation. Too many shards also bring additional overhead: distributing search commands to each shard and merging of shard results. #-- Paths-- # set the storage path of index data. The default is the data folder under the es root directory. You can set multiple storage paths separated by commas. # example: # path.data: / path/to/data1,/path/to/data2 path.data: / path/elasticsearch# sets the storage path for log files The default is the logs folder path.logs: / var/logs/elasticsearch#-- Memory-- # under the es root directory to lock the physical memory address to prevent elasticsearch memory from being swapped out, that is, to prevent es from swapping partitions with swap. # because es is less efficient when jvm starts swapping, to ensure that it is not swap, you can set the two environment variables ES_MIN_MEM and ES_MAX_MEM to the same value, and ensure that the machine has enough memory allocated to es. # also allow elasticsearch processes to lock memory Under linux, you can use the command bootstrap.memory_lock: true#-- Network-- # to set ip binding for es under linux: 192.168.0.setting the http port of external service The default is 920. Note: if you start multiple es nodes in the same server, the default listening port number will be automatically increased by 1: for example: 9200 ~ 9201 9202...http.port: 920 nodes-- Discovery-- # when a new node is started, the node is discovered through this ip list, and a cluster is set up # default node list: # 127.0.0.1 Represents the loopback address of the ipv4. # Note: if you are discovering es services in other servers, you can not specify a port [default 9300]. If you are discovering es services in the same server, you need to specify a port. Discovery.zen.ping.unicast.hosts: ["192.168.0.1", "192.168.0.2" "192.168.0.3"] # configure this parameter to prevent brainfissure (total number of nodes in the cluster / 2) + 1discovery.zen.minimum_master_nodes: clusters-- Gateway-- -# after N nodes in a cluster are started To allow data recovery processing. The default is 1gateway.recover_after_nodes: disable-- Various-- # disable starting multiple es services on one server # node.max_local_storage_nodes: setting whether or not You can delete or close the index library through regular or _ all The default true means that the index library name must be explicitly specified # production environment is recommended to be set to true, and must be explicitly specified when deleting the index library, otherwise the index library # action.destructive_requires_name: true in the index library may be deleted mistakenly

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

Internet Technology

Wechat

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

12
Report