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