ElasticSearch (distributed full-text search engine)

1.Lucene optimized to achieve a search program distributed cluster of high availability

2. First, ES indexed database management support is still open source search engine based on Apache Lucene (TM) is. Java ES also be used to develop and use Lucene as its core to achieve all index and search function, but its purpose is to hide the complexity of Lucene by a simple RESTful API, allowing full-text search easier.

3.ES features

a) real-time distributed file storage, each of the fields are indexed and can be searched

A distributed real-time analysis search engine

It can be extended to hundreds of servers, PB processing stage structured or unstructured data

Highly integrated services, you can use a simple RESTful API, customers in various languages end even interact with the command line.
ES supports distributed cluster

 

b) Elasticsearch very easy to get started. It offers many sensible defaults, beginners and hides the complexity of the search engine theory. It has the effect of a bottle ready to drink (installation to use), with little learning can be used in a production environment.

c) a similar framework ES

            i. ES management framework to carry their own distributed coordination function, but only support data json format

           . Ii Solr (heavyweight plus frame): zookeeper using the distributed management, support more data formats, do many configurations use

         iii. Katta based on Lucene
Lucene supports distributed, scalable, fault-tolerant, quasi-real-time search scheme. Advantages: out of the box, can be realized with distributed Hadoop fit. With extensions and fault tolerance.
Cons: Just search program, indexing part still need to achieve their own. In the search, only to achieve the most basic needs. Less successful cases, the maturity of the project is slightly worse.

           iv.     HadoopContrib

  1. Map / Reduce mode, distributed indexing scheme, can cooperate with Katta use. Advantages: distributed indexing, is scalable. Cons: Just indexing scheme that does not include search implementation. Work in batch mode, poor support for real-time search.

d) Summary: ElasticSearch lucene simplifies the use of full-text search, while increasing the distributed nature, such that the full-text search build large-scale distributed very easily.

  1. ES installation and use

a) Installation ES: Download the archive decompression, and then run on the line elasticsearch.bat
browser running: 127.0.0.1: 9200

Three state b) ES server

            i.     Green—yellow--red

c) ES interact

            i. API restFul of interaction, and all clients based interaction through data exchange format json

           ii. two ways to interact with Java API

  1. Node client
    node a client in a non-data node (none data node) identity to the cluster, in other words, that they do not store any data, but it knows the specific location of the data in the cluster, and is capable of forwarding the request directly to the corresponding node.
  2. Transfer client
    the lighter transport a client to send a request to the remote cluster. It they do not join the cluster, simply forward the request to the cluster nodes.
    Two Java client to interact with the cluster through a 9300 port, transport protocol using the ES (ES Transport Protocol). 9300 also communicates through ports between nodes in the cluster. If this port is not open, you will not form a cluster node.

note

ES version of the Java client resides must be consistent with the other nodes in the cluster, otherwise, they might not recognize each other.

d) Restful expand understanding of style

e) auxiliary management tool (kibana)

            . i ① Kibana5.2.2 Download: https://www.elastic.co/downloads/kibana

           ii. ② decompress and edit config / kibana.yml, the value set has been activated elasticsearch.url ES

         . Iii ③ 启动 Kibana5: bin \ kibana.bat

           iv ④ default access address:. HTTP: // localhost: 5601

  1. Understanding ElasticSearch

a) Concept: Lucene and are the same as for full-text search, the difference is Lucene is a full-text search tool bag, and ES is a full-text search server

b) full-text search: Query-based technology index data, instead of fuzzy query, improving the efficiency of the query

Shortcomings c) Lucene: the use of complex, only supports JAVA language environment, Lucene can not do clusters

d) The ES makes up for lack of Lucene

            i. ElasticSearch lucene simplifies the use of full-text search, while increasing the distributed nature, such that the full-text search build large-scale distributed very easily.

           ii. ES cluster support itself,

         iii. ES Lucene carried on a wrapper, the original index is created Lucene code to create a pair of indexes, and creating an index ES send a http request only enough

  1. ES server installation

a) download compressed ES

b) extracting

c) Start bin / elasticsearch.bat

d) test whether start: HTTP: // localhost: 9200

e) you can see the health status of ES cluster startup kibana

  1. ES graphical client installation

1)curl

   windows are not supported, you need to linux

2) POSTER Firefox plug-in interface

3) kibana

The official recommendation

4) the front end of head comparison cock, and can see the replica shard

5)postman

a) visual interface selected here kibana

            i. the download package

           ii. Extract installation

         . Iii modify config / kibana.yml profile: elasticsearch.url port path setting value of the activated ES

           iv. Start kibana

            . V Access localhost: 5601

  1. ElasticSearch-Head mounting

a) extracting archive, and then run the install command cmd
npm install, run and npm run start command

After installation is connected to ES, need to be configured in elasticsearch / config / elasticsearch.yml in, http.cors.enabled: true

http.cors.allow-origin: "*", before you can connect to the server ES

Guess you like

Origin www.cnblogs.com/8888-lhb/p/11520797.html