Build an Elasticsearch cluster in CentOS 7

Source: Internet
Author: User

Build an Elasticsearch cluster in CentOS 7

Environment Description:
Server (System Version CentOS 7)
Elasticsearch version: elasticsearch-6.2.2
Elasticsearch Directory:/home/soft/

192.168.33.10 master
192.168.33.11 master data
192.168.33.12 master data

1. Create an elasticsearch account [elasticsearch is used for all three machines]
Useradd es
Passwd es

2. Create a data directory And a log directory [all three machines are the same]

Mkdir-p/home/soft/elasticsearch-6.2.2/data/

Mkdir-p/home/soft/elasticsearch-6.2.2/data/logs/

3. modify directory permissions [the same for all three machines]

Chown-R es: es/home/soft/elasticsearch-6.2.2

4. modify configuration information

I. 192.168.33.10 configuration information:
Cluster. name: my-application
Node. name: node-192-168-33-10
Path. data:/home/soft/elasticsearch-6.2.2/esData/data
Path. logs:/home/soft/elasticsearch-6.2.2/esData/logs
Bootstrap. memory_lock: false
Bootstrap. system_call_filter: false
Network. host: 192.168.33.10
Http. port: 9200
Discovery. zen. ping. unicast. hosts: ["192.168.33.10: 9300", "192.168.33.11: 9300", "192.168.33.12: 9300"]
Discovery. zen. minimum_master_nodes: 2
Gateway. recover_after_nodes: 3
Node. master: true
Node. data: false
Node. ingest: false
Search. remote. connect: false

Ii. 192.168.33.11 configuration information:
Cluster. name: my-application
** Node. name: node-192-168-33-11 **
Path. data:/home/soft/elasticsearch-6.2.2/esData/data/
Path. logs:/home/soft/elasticsearch-6.2.2/esData/logs/
Bootstrap. memory_lock: false
Bootstrap. system_call_filter: false
** Network. host: 192.168.33.11 **
Http. port: 9200
Discovery. zen. ping. unicast. hosts: ["192.168.33.10: 9300", "192.168.33.11: 9300", "192.168.33.12: 9300"]
Discovery. zen. minimum_master_nodes: 2
Gateway. recover_after_nodes: 3
Node. master: true
** Node. data: true **
Node. ingest: false
Search. remote. connect: false

Iii. 192.168.33.12 configuration information
Cluster. name: my-application
** Node. name: node-12 **
Path. data:/home/soft/elasticsearch-6.2.2/esData/data/
Path. logs:/home/soft/elasticsearch-6.2.2/esData/logs/
Bootstrap. memory_lock: false
Bootstrap. system_call_filter: false
** Network. host: 192.168.33.12 **
Http. port: 9200
Discovery. zen. ping. unicast. hosts: ["192.168.33.10: 9300", "192.168.33.11: 9300", "192.168.33.12: 9300"]
Discovery. zen. minimum_master_nodes: 2
Gateway. recover_after_nodes: 3
Node. master: true
Node. data: true
Node. ingest: false
Search. remote. connect: false

4. Start elasticsearch-6.2.2 as An es user [three machines]
./Bin/elasticsearch
After the cluster is successfully started, use CURL to test whether the cluster is successfully built.
Curl http: // 192.168.33.11: 9200/_ cat/nodes? V

Simple setup of Elasticsearch Clusters

At this point, a simple cluster has been successfully built, and now node-12 is the master node.

Note:
The cluster. name values of the three machines must be the same, and the node. name values must be different.

List of problems encountered during startup:

1. Simple setup of Elasticsearch Clusters

Solution:
Vim/etc/security/limits. conf. Add two new lines:
Es soft nofile 65536
Es hard nofile 65536

2. Simple setup of Elasticsearch Clusters

Solution:
When discovery. zen. ping. unicast. hosts is configured, add the port

Elasticsearch Tutorials:

Installation and deployment of ElasticSearch on Linux
Linux Elasticsearch 1.7.0 installation configuration https://www.bkjia.com/Linux/2017-05/144215.htm
Install the Elasticsearch 16.04 analysis engine https://www.bkjia.com/Linux/2017-07/145588.htm in Ubuntu 5.4
Elasticsearch1.7 upgrade to 2.3 practice summary https://www.bkjia.com/Linux/2016-11/137282.htm
Elasticsearch cluster configuration https://www.bkjia.com/Linux/2017-01/139460.htm in Ubuntu 14.04
Elasticsearch-5.0.0 porting to Ubuntu 16.04 https://www.bkjia.com/Linux/2017-01/139505.htm
Build https://www.bkjia.com/Linux/2017-04/143136.htm for ElasticSearch 5.2.2 Cluster Environment
Install search engine Elasticsearch https://www.bkjia.com/Linux/2017-05/144105.htm in Linux
How to install ElasticSearch on CentOS https://www.bkjia.com/Linux/2017-05/143766.htm
Elasticsearch5.3 install plug-in head https://www.bkjia.com/Linux/2017-09/147008.htm

ElasticSearch details: click here
ElasticSearch: click here

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151158.htm

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.