In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "how to install ElasticSearch and Kibana under Docker", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to install ElasticSearch and Kibana under Docker" article.
1. Preface
Elasticsearch is quite popular now, and many companies are using it.
2.elasticsearch installation
2.1 docker install es
To use es must need to install, because I am used to using docker, so I also want to try it on docker, mainly because I have a lot of software and choose docker. Docker installation is actually very simple, as for one line of command. Here, I choose the 7.2.0 image installation of es. The specific installation commands are as follows:
Docker pull elasticsearch:7.2.0
Enter after typing the command, just wait for the download with the image to be completed.
2.2 start es
After the installation is completed, of course, we need to start our es, and it is also very convenient to start here with one line of command. It is as follows:
Docker run-- name elasticsearch-p 9200 discovery.type=single-node 9200-p 9300 discovery.type=single-node 9300-d elasticsearch:7.2.0
So the es starts up. We can check to see if the es installation is complete, and we can enter the command:
Curl http://localhost:9200
Or open the http://localhost:9200 URL in the browser, and if you can see the following message, it means that our es has been installed.
{"name": "530dd7820315", "cluster_name": "docker-cluster", "cluster_uuid": "7o0fjpbjtkmn_axwmzx0rq", "version": {"number": "7.2.0", "build_flavor": "default", "build_type": "docker", "build_hash": "508c38a", "build_date": "2019-06-20t15:54:18.811730z" "build_snapshot": false, "lucene_version": "8.0.0", "minimum_wire_compatibility_version": "6.8.0", "minimum_index_compatibility_version": "6.0.0-beta1"}, "tagline": "you know, for search"}
If you install it on a server, you must also open port 9200 of your server to access it, and then change localhost to your server's ip address.
2.3 modify the configuration to resolve cross-domain access issues
First go to the container, and then go to the specified directory to modify the elasticsearch.yml file.
Docker exec-it elasticsearch/ bin/bashcd / usr/share/elasticsearch/config/vi elasticsearch.yml
Add the following at the end of the elasticsearch.yml file:
Http.cors.enabled: truehttp.cors.allow-origin: "*"
Restart the container after modifying the configuration.
Docker restart elasticsearch
2.4 install the ik word splitter
Es's built-in word splitter is not very friendly to Chinese word segmentation, so we download the open source ik word splitter to solve this problem. First, go to the plugins directory to download the word splitter, then decompress it after the download is complete, and then restart es. The specific steps are as follows:
Note: the version of elasticsearch needs to be consistent with the version of ik splitter, otherwise it will fail when rebooting. You can view all versions here and select the right-click copy link address for your own version.
Cd / usr/share/elasticsearch/plugins/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.2.0/elasticsearch-analysis-ik-7.2.0.zipexitdocker restart elasticsearch
You can then verify that the installation is successful in the dev tools of the kibana interface
Post test/_analyze {"analyzer": "ik_max_word", "text": "Hello, I am Dongye jiafly"}
If you don't add "analyzer": "ik_max_word", it's a word segmentation. You can try it after the kibana installation below is complete.
3.kibana installation
3.1 docker install kibana
The same applies to the docker installation kibana command as follows:
Docker pull kibana:7.2.0
Just wait for all the images to be downloaded.
3.2 start kibana
After the installation, you need to start the kibana container and use-- link to connect to the elasticsearch container. The command is as follows:
Docker run-- name kibana-- link=elasticsearch:test-p 5601 link=elasticsearch:test-d kibana:7.2.0docker start kibana
After startup, you can open a browser and enter http://localhost:5601 to open the interface of kibana.
The above is about the content of this article on "how to install ElasticSearch and Kibana under Docker". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.