Elasticsearch Related Configurations

Source: Internet
Author: User

?1. Virtual memory

On Linux systems, Elasticsearch uses hybrid Mmapfs/niofs to store index files by default, so the operating system restricts the storage space primarily through mmap, so if the storage space is full, an exception is thrown. We can use the following command to change the settings

Sysctl-w vm.max_map_count=262144

Of course we can also modify the/etc/sysctl.conf configuration file to modify the above parameters

Note that we typically set swap under Linux, but setting swap will have an impact on Elasticsearch's node performance, so it is recommended to close the swap.

The second scenario can also be set to sysctl.conf in vm.swappiness need to be set to 1

The third scenario can be modified in the ELASTICSEARCH.YML configuration file bootstrap.mlockall:true

Once set up, we can use the following command to see if Bootstrap.mlockall is in effect

Curl Http://localhost:9200/_nodes/process?pretty
2. Configure Elasticsearch

2.1 In ELASTICSEARCH.YML we can set the

Path:logs:/var/logs/elasticsearch data:/var/data/elasticsearch Plugins:/var/data/plugins conf :/etc/conf

So we can see that we output the log to/var/logs/elasticsearch, save the index data in the/var/data/elasticsearch directory, the plug-in location is set to/var/data/plugins, The configuration file drop location is set to/etc/conf.

Of course, we can also directly path.logs:/var/logs/elasticsearch this configuration

2.2 Configuring the cluster name, node name

Cluster:name:mycluster
Node:name:mynode

This sets the cluster name to Mycluster, and the node name for the current Elasticsearch is Mynode

2.3 Setting the index storage mode

Index:store:type:memory

Here we set the Ile Index storage method is memory, in fact, this setting in the Yml file is not a good configuration, because after the configuration, all of the indexes we create will be stored in memory, so the best setting is to use the HTTP interface to configure the specified database

Like what:

$ curl-xput http://localhost:9200/kimchy/-d ' index:store:type:memory '

That is, the database Kimchy set storage mode for memory.

3. Configure the data operation for the HTTP interface.

3.1 Generally we use the HTTP interface API as a CRUD for index data, and this is where we configure the HTTP module in ELASTICSEARCH.YML.

Http.enabled:true















Elasticsearch Related Configurations

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.