Getting started with ElasticSearch cluster creation

Source: Internet
Author: User

Getting started with ElasticSearch cluster creation

ElasticSearch is the best choice if you want to build your own search engine. This article describes how to build an ElasticSearch cluster and install related plug-ins.

I. Environment Introduction and installation preparation

1. Environment Description

The OS is Ubuntu13.04 and the ip addresses are xxx. xxx. xxx.140 and xxx. xxx. xxx.145.

2. Installation preparation

ElasticSearch (ElasticSearch) is implemented in java, and the runtime environment depends on java. Elasticsearch 1.x officially recommends that you use at least the JDK environment. We recommend that you use Oracle Java to download it from the official website. This document uses jdk-7u51-linux-i586.gz. Escan be downloaded from the official website or from here. This article uses elasticsearch-1.0.1.tar.gz.

Ii. Installation

1. install JAVA

For Java installation instructions, refer to here.

2. Install elasticsearch

(1)decompress elasticsearch-1.0.1.tar.gz, sudo tar-zvxf elasticsearch-1.0.1.tar.gz, generate the Directory: elasticsearch-1.0.1 in the current path; make a soft connection for the Directory ln-s elasticsearch-1.0.1 elasticsearch. After completion, the directory structure is as follows:

(2) Configure es. Here only do the simplest configuration, modify the ES_HOME/config/elasticsearch. yml file, set the value of node. name to "test-node1", indicating that the current es service node name is test-node1.

(3) Start ES. Go to the ES installation directory, run the command bin/elasticsearch-d-Xms512m-Xmx512m, and enter http: // ip: 9200/in the browser to check whether the page is started properly. Status = 200 indicates that elasticsearch is started normally, and elasticsearch version information is displayed. name indicates the value of node. name in the configuration file.

(4) install elasticsearch in the same step on another machine, because at least two services are considered as clusters! Note that When configuring, set the value of node. name To test-node2, in short, it must be different from the previously configured value.

Because cluster. name = elasticsearch is used by default in the configuration file, the two ECs instances are automatically built into a cluster named elasticsearch.

3. Plug-in Installation

After the cluster is successfully installed, you need to check the index data and running status of the Cluster. You need to install some plug-ins for the index. To do a good job, you must first sharpen the tool. The following describes some practical plug-ins:

(1) head

Like the plug-in name, we recommend this plug-in first. With head, you can view almost all information about the cluster, perform simple search and query, and observe automatic recovery.

Run the following command to start the installation: sudo elasticsearch/bin/plugin-install mobz/elasticsearch-head

Remember to install both machines. After the installation is complete, enter http: // ip: 9200/_ plugin/head/in the browser to view the display effect. For example:

Cluster health: green (2, 20): indicates that the cluster is currently healthy. The cluster contains two machines, with a total of 20 indexes. The thick-line green box indicates the primary partition, and the thin-line green box indicates the backup partition.

There are many other functions. Please try them yourself.

(2) bigdesk

Bigdesk is a Cluster Monitoring plug-in that allows you to view the resource consumption, cpu, memory, and http links of the entire cluster.

Run the following command to install sudo elasticsearch/bin/plugin-install lukas-vlcek/bigdesk.

After the installation is complete, enter http: // ip: 9200/_ plugin/bigdesk/# nodes in the browser. The page is displayed as follows:

Click the test-node1 node to view the resource usage of a single node, including JVM, Thread Pools, OS, Process, HTTP & Transport, Indice, File system.

Elasticsearch has many plug-ins. For more information, see elasticsearch plug-ins.

Elasticsearch installation and usage tutorial

ElasticSearch configuration file Translation

ElasticSearch cluster creation instance

Build a standalone and server environment for distributed search ElasticSearch

Working Mechanism of ElasticSearch

ElasticSearch details: click here
ElasticSearch: click here

This article permanently updates the link address:

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.