Docker安裝elasticsearch 7.7.0

1、pull 鏡像

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.7.0

2、運行elasticsearch

docker run --name=elastic770 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --network=network_172_19 --ip=172.19.0.101 -v /var/docker/elastic/data:/data docker.elastic.co/elasticsearch/elasticsearch:7.7.0

注意測試環境加上-e "discovery.type=single-node"

3、安裝ik分詞插件

docker exec -it elastic770 /bin/bash

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip

4、其他配置

docker exec -it elastic770 /bin/bash

yum update

yum install vim

vim /config/elasticsearch.yml

修改elasticsearch.yml

cluster.name: "elasticsearchSZGHJ"

network.host: 0.0.0.0

node.name: node0

http.host: 0.0.0.0

http.cors.enabled: true

http.cors.allow-origin: "*"

5、安裝可視化管理工具

docker run -p 9800:9800 -d --network=network_172_19 --link elastic770:hd containerize/elastichd

在瀏覽器打開http://localhost:9800

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章