This is the 18th day of my participation in Gwen Challenge.
elasticsearch
1. Pull the mirror
1) inhub.docker.comSearch for elasticSearch and check the Tag version Docker pull ElasticSearch :7.4.2==
2. Start
When started directly, the container will automatically flash back, because ES requires a large amount of JVM memory
docker run -d -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node"-p 9200:9200 -p 9300:9300 --name ElasticSearch :7.4.2Copy the code
After the startup is successful, access 192.168.xx.xx:9200/. If the figure is displayed, the startup is successful
{
"name" : "4cbd80c5d91f"."cluster_name" : "docker-cluster"."cluster_uuid" : "G7fyOgPmSom0xB4XWZ9Oow"."version" : {
"number" : "7.4.2"."build_flavor" : "default"."build_type" : "docker"."build_hash" : "2f90bbf7b93631e52bafb59b3b049cb44ec25e96"."build_date" : "The 2019-10-28 T20:40:44. 881551 z"."build_snapshot" : false."lucene_version" : "8.2.0"."minimum_wire_compatibility_version" : "6.8.0"."minimum_index_compatibility_version" : "6.0.0 - beta1"
},
"tagline" : "You Know, for Search"
}
Copy the code
Install Chinese word segmentation
- Into the container
docker exec -it elasticsearch /bin/bash
2. View the elasticSearch versionelasticsearch -version
3. Install the version online./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.2/elasticsearch-analysis-ik-7.4.2.zip
4. Exit and restart the containerexit
thendocker restart elasticsearch
5. Testcurl -X GET -H "Content-Type: application/json" "http://localhost:9200/_analyze? Pretty =true" -d "{" text-indent ":" 0 "}';
The default is word segmentation for each Chinese character
Ik_max_word and ik_smart
After the word segmentation is installed, each Chinese character is used by default. Parameter Analyzer is added to group words. Ik_max_word and IK_smart are used as parameter values. curl -X GET -H “Content-Type: application/json” “http://localhost:9200/_analyze? Pretty = true “3-d” {” text “, “China” in five thousand, “analyzer” : “ik_max_word”} “;
kibana
Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You can search and view data stored in Elasticsearch using Kibana. Kibana and Elasticsearch interact with various charts, tables, maps, etc. to visually display data, so as to achieve advanced data analysis and visualization.
Download run start
Docker run --name kibana --link= elasticSearch -p 5601:5601 -d kibana:7.4.2 docker start kibanaCopy the code