1. Introduction of Elasticsearch

Es is a full-text search engine based on Lucene. This paper mainly demonstrates the operation of ES in MAC environment and the use of some tools. The ES version of this paper is 6.5.4.

Es the download address: artifacts. Elastic. Co/downloads/e… .

Kibina download address: www.elastic.co/cn/download…

Es Header plugin address: github.com/mobz/elasti…

2. Start Elasticsearch

2.1 Elasticsearch start

/ elasticSearch the elasticsearch file is decompressed and run in the bin directory. After the elasticsearch file is successfully started, visit http://localhost:9200/ and you can view basic information.

In this example, cluster_name and name are random strings. You can modify name and Cluster_name in the config/ elasticSearch. yml file. After the modification, restart es, and you can see the configured name and cluster.name.

cluster.name: zhenxian
node.name: test
Copy the code

2.2 Elasticsearch-head plugin

Elasticsearch-head is written in JS, so node and NPM need to be installed before using it. After the elasticSearch-head plug-in is installed, download the elasticSearch-head plug-in, run NPM install to install the elasticSearch-head plug-in, and run NPM run start to start the elasticSearch-head plug-in. If the NPM installation is too slow, you can use Taobao’S CNPM to install it. Select * from config/ elasticSearch. yml and restart es after installing the plugin. You can’t connect to es using NPM run start.

http.cors.enabled: true
http.cors.allow-origin: "*"
Copy the code

You can use the elasticSearch-head command to view the current cluster status, such as the cluster name, number of nodes in the cluster, node index information, and cluster health status.

2.3 Kibina use

Elasticsearch-head provides basic operations and information as a plugin, while Kibina provides a better visualization and richer functionality than ElasticSearch-Head. Let’s take a look at kibina’s startup. Download unzip and start./kibina.

After successful startup, we can go to dev Tools and do some operations on es via HTTP request, such as creating an index called book. After the new index is created successfully, you can add, delete, change and search the index.

3. Summary

I just started to write something, but it’s not very good. I hope I can stick to it and look back after two years.

For more exciting content, please pay attention to the public number