Full record of installation and deployment of ElasticSearch on Linux

Source: Internet
Author: User

Full record of installation and deployment of ElasticSearch on Linux

To meet the project requirements, you need to build an ElasticSearch service on the Linux platform. Various problems are encountered during the construction process. Later, they all solved the problem one by one. Now we need to record this process and the problems encountered and their solutions.

I. Environment Configuration

    • Operating System: Cent OS 7
    • ElasticSearch version: 1.4.1
    • JDK version: 1.7
    • SSH Secure Shell version: 3.2.9
    • Elasticsearch-servicewrapper: elasticsearch service plug-in, which is generally used in Linux.

Ii. Operation Process

1. As a system service application, elasticsearch can install the elasticsearch-servicewrapper plug-in.

Download the plug-in at https://github.com/elasticsearch/elasticsearch-servicewrapperand decompress it. Copy the service directory to the bin directory of the elasticsearch directory. The advantage of running this plug-in is that the jvm parameters and other configurations required by elasticsearch have been configured, which is very convenient.

2. Use the SSH Secure Shell Connection Tool to upload the ES and Sevice folders to the corresponding directories in linux.

3. In the linux environment, enter the bin/service directory of the ES directory, for example, run the command sh elasticsearch start

4. Install the es-head plug-in

Go to the elasticsearch/bin directory and enter the command./plugin-install mobz/elasticsearch-head to install the head plug-in.

5. In the browser, enter http: // localhost: 9200, http: // localhost: 9200/_ plugin/head/, as shown in, then ES starts successfully.

6. If you want to stop the elasticsearch service, enter sh elasticsearch stop. If the output is as follows, elasticsearch stops successfully.

 

Iii. Problems and Solutions

1. When elasticsearch is started on linux and the elasticsearch plug-in is installed with the plug-in command, the following problems occur. Here we use plugin as an example to provide a solution.

If this problem is found, run the ls-l command to view the file operation permissions,

Attachment: File Permissions

  • R-Files can be read.

  • W-Files can be written.

  • X-The file can be executed (if it is a program)

It can be seen that the plugin file owner has only the read and write permissions and has no execution permission. Therefore, you must add executable permissions to this file.

Apply the command chmod + x plugin to operate

Then input ls-l to check whether the X permission is available.

Install plug-in head in plug-in.

2. When you run es, an error will be displayed, similar to some version error errors. If the JDK version is not 7, elasticsearch may fail to start. Opensdk7 is not recommended for linux.

Elasticsearch depends on Java 7. We recommend that you use Oracle JDK 1.7.0 _ 55. Java installation varies across platforms, so we don't want to go into too many details here. I just want to say that before you install Elasticsearch, you can run the following command to check your Java version (if necessary, install or upgrade it): java-version

3. After JDK7 is installed, the system will have two versions of java. To ensure that java 7 is called, you need to modify the environment variables to ensure that the java 7 path is at the beginning.

Enter the command: vim ~ /. Open the environment variable content in bashrc:

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.