Elasticsearch is a distributed, extensible, real-time search and data analysis engine
Elasticsearch not only full-text search, but also supports structured search, data analysis, complex language processing, geographic location, and inter-object correlation. At the same time, Elasticsearch has super-strong horizontal scalability, which can distribute load pressure and stability to multiple nodes. The application scenario has the commodity search in the e-commerce system, the system log aggregation retrieval, the user behavior tracking analysis and so on;ES Cluster service environment Construction Build ES cluster (three-node, 3-piece/3-piece environment)Win10, Jdk8, es5.6.2, kibana5.6.3 (visual operations es), Sense-2.0.0-beta7 (a Kibana app that provides an interactive console to submit requests directly to Elasticsearch via your browser) download ES, Kibana, try to keep both versions consistent with the new folder Es-cluster, copy the ES compressed package to the folder and extract three copies, respectively namedelasticsearch-5.6.2-9201, elasticsearch-5.6.2-9202, elasticsearch-5.6.2-9203,
Then create the Data folder (.. /es-cluster/data) Log storage folder (.. /es-cluster/log) Modify the profile in the ES node service (.. /ES-CLUSTER/ELASTICSEARCH-5.6.2-9201/CONFIG/ELASTICSEARCH.YML), example Reference (src/resources/config/es/*), starting node 9201, performing (.. /es-cluster/elasticsearch-5.6.2-9201/bin/elasticsearch.bat), access the service Es-health, which shows the service status asRed,
Indicates that not all primary shards are available, the current machine is not working properly, because we configured in the configuration file at least 2 nodes on-line, will do the master election start node 9202, execute (.. /es-cluster/elasticsearch-5.6.2-9202/bin/elasticsearch.bat), revisit the service Es-health and discover that the service status has changed toGreen,
Indicates that all main and sub-slices are available and the machine works properly
6.1. (can be ignored) installation sense, _bin\kibana-plugin.bat install Elastic/sense_, if the installation fails please download sense directly and then
_bin\kibana-plugin.bat install-d "" Sense
Unzip the Kibana to Es-cluster/kibana-5.6.2-windows-x86, modify the configuration kibana-5.6.2-windows-x86/config/kibana.yml Elasticsearch.url: "http://localhost:9201",
Example Reference (src/resources/config/kibana/*)
Start Kibana, execute (.. /es-cluster/kibana-5.6.2-windows-x86/bin/kibana.bat), Access Kibana-service adds an index named ' Blogs ' and assigns it three shards and attached a sub-slice per shard, When the Kibana panel is open, execute it in the Dev Tools menu
Curl-xput ' Localhost:9200/blogs?pretty '-h ' content-type:application/json '-d '
{
"settings": {
"number_ Of_shards ": 3,
" Number_of_replicas ": 1
}
}
Once again, visit the ES service to see the state status and see the corresponding Shard status.
Setting up ES Cluster service environment in Docker
1. After installing Docker, open a command line (PowerShell), search under the Docker-hub Center warehouse Elasticsearch, the results list of the highest number of concerns is elastic the official ES image, We will use it to launch our ES container service;
Docker Search Elasticsearch
2. Download the image locally (we can also log in to your Docker-hub account and upload your own image)
Docker Pull Elasticsearch
3. Use image as a template to start Docker-container, you can provide ES services
Docker run-it--name es-p 9200:9200-p 9300:9300-v d:/docker/data/es:/usr/share/elasticsearch/data-v D:/docker/logs/es /:/user/share/elasticsearch/logs Elasticsearch
A) Run: Create a new container and run the specified command
B)-it: Run the container in interactive mode,
C)-name: name specified for the container
D)-P: Host port is mapped to the container port, you can access the host port to implement the container port Access
E)-V: In-container directory of host directory Mappings
F) The last name is the name of the mirror, you can specify a mirror server, etc. by default, the Docker official hub