Elasticsearch cluster configuration

Source: Internet
Author: User

Because of the limited machine, this article only makes the cluster test of 3 nodes in a single machine.

1. Cluster test information

Elasticsearch version: elasticsearch-2.4.1

Windowns version: Win10

2, decompression elasticsearch-2.4.1.zip to any directory, install Elasticsearch-head plug-in.

Execute command in ${eshome}\bin directory: Plugin install Mobz/elasticsearch-head

3. After a single node is started, you can view the following information (effect after adding data)

4, the Elasticsearch copy 3 copies, respectively named Elasticsearch-2.4.1-1, Elasticsearch-2.4.1-2, elasticsearch-2.4.1-3

5, modify the configuration information of each node

1) Modify the ELASTICSEARCH-2.4.1-1\CONFIG\ELASTICSEARCH.YML and add the following information:

Cluster.name:elasticsearchnode.name:node-1node.master:truenode.data:truenetwork.host:127.0.0.1http.port: 9201transport.tcp.port:9301discovery.zen.ping.multicast.enabled:falsediscovery.zen.ping.timeout: 40sdiscovery.zen.ping.unicast.hosts: ["127.0.0.1:9301",  "127.0.0.1:9302", "127.0.0.1:9303"]

2) Modify the ELASTICSEARCH-2.4.1-2\CONFIG\ELASTICSEARCH.YML and add the following information:

Cluster.name:elasticsearchnode.name:node-2node.master:truenode.data:truenetwork.host:127.0.0.1http.port: 9202transport.tcp.port:9302discovery.zen.ping.multicast.enabled:falsediscovery.zen.ping.timeout: 40sdiscovery.zen.ping.unicast.hosts: ["127.0.0.1:9301",  "127.0.0.1:9302", "127.0.0.1:9303"]

3) Modify the ELASTICSEARCH-2.4.1-3\CONFIG\ELASTICSEARCH.YML and add the following information:

Node.name:node-3node.master:truenode.data:truenetwork.host:127.0.0.1http.port:9203transport.tcp.port: 9303discovery.zen.ping.multicast.enabled:falsediscovery.zen.ping.timeout:40sdiscovery.zen.ping.unicast.hosts: [ "127.0.0.1:9301",  "127.0.0.1:9302", "127.0.0.1:9303"]

6, login any one node, you can see the following information:

3 indexes of data are distributed to 3 nodes, each shard has 2 backups, and Node-2 is the master service.

7, close the node node-3, the first 2 nodes can see the following information (waiting for a period of time):

The shards are transferred to the node-1 and NODE-2 nodes.

8. Reopen the Node-3 node, and the data is evenly divided into 3 nodes.

Elasticsearch cluster 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.