How to install ElasticSearch in centOS

Source: Internet
Author: User


ElasticSearch overview

ElasticSearch is a highly scalable open-source full-text search and analysis engine.
It allows you to quickly store, search, and analyze large amounts of data. ElasticSearch is usually used as a backend program to provide services for applications that require complex queries.
Elasticsearch is a Lucene-based open-source distributed search engine with distributed multi-user capabilities. Elasticsearch is developed in java and provides Restful interfaces to achieve real-time search and high-performance computing. At the same time, Elasticsearch has strong horizontal scalability and does not need to restart the service, and basically has achieved zero configuration.


ElasticSearch installation
Preparations before installation
Install java Library

Yum install java-1.8.0-openjdk
Download the ElasticSearch installation package

Wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.2.1/elasticsearch-2.2.1.zip
Extract

Unzip elasticsearch-2.2.1.zip
Go to elasticsearch/bin and run the elasticsearch script to start

Cd elasticsearch-2.2.1
Cd bin
./Elasticsearch
The following error occurs:

Exception in thread "main" java. lang. RuntimeException: don't run elasticsearch as root.
At org. elasticsearch. bootstrap. Bootstrap. initializeNatives (Bootstrap. java: 93)
At org. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 144)
At org. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 285)
At org. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)
Refer to the log for complete error details.
Solution:
Create an elsearch user group and an elsearch user

Groupadd elsearch
Useradd elsearch-g elsearch-p elasticsearch
Change the user and group of the elasticsearch folder and internal files to elsearch: elsearch
Enter the following command under the parent directory of the elasticsearch-2.2.1 Directory

Chown-R elsearch: elsearch elasticsearch-2.2.1
 
Switch to elsearch and start again

Su elsearch
Enter the bin directory

Cd elasticsearch-2.2.1/bin
Start the program:

./Elasticsearch
ElasticSearch backend startup command

./Elasticsearch-d

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.