This is the 19th day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021

Elasticsearch is an open source distributed search engine that collects, analyzes, and stores data. Its features are: distributed, zero configuration, automatic discovery, index automatic sharding, index copy mechanism, restful interface, multi-data sources, automatic search load and so on.

Download and install Elasticsearch

1.1 download

  • You can download the installation package from the official website of Elasticsearch

  • Mac can be downloaded and installed directly from BREW

1.1.1 Enter the following command in terminal (brew has been installed)

setp1: brew tap elastic/tap
Copy the code

step2: brew install elastic/tap/elasticsearch-full
Copy the code

1.1.2 start Elasticsearch

./elasticsearch
Copy the code

You can check whether the startup is successful by visiting localhost:9200.

The information about Elasticsearch is displayed after the startup succeeds

1.2 Elasticsearch File directory Structure

directory The configuration file describe
bin Script files to start ElasticSearch, install plug-ins, run statistics, etc
config elasticsearch.yml Cluster configuration file, SUER,role Based configuration
JDK Java runtime environment
data path.data The data file
lib Java class library
logs path.log The log file
modules Contains all ES modules
plugins Contains all installed plug-ins

1.3 Installing Elasticsearch

1.3.1 Checking Elasticsearch plug-ins Installed

1. Perform:

/bin/elasticsearch-plugin list
Copy the code

2. Run the following command to install the international segmentation plug-in

./elasticsearch-plugin install analysis-icu
Copy the code

Visit http://localhost:9200/_cat/plugins to view the installed plug-ins

1.4 Multi-node Cluster

Enter the following command:

bin/elasticsearch -E node.name=node0 -E cluster.name=geektime -E path.data=node0_data -d
bin/elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data -d
Copy the code

You can execute the command together. After the command is successfully enabled, you can view it in http://localhost:9200/_cat/nodes.