欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Docker安装elasticsearch 7.7.0

程序员文章站 2022-03-12 12:01:06
...

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" -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://jeecgos.oss-cn-beijing.aliyuncs.com/eoafile/elasticsearch-analysis-ik-7.7.0.zip

 

4、其他配置

 

创建 elasticsearch.yml

cluster.name: "elasticsearch7.7.0"
network.host: 0.0.0.0
node.name: node0
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"

拷贝到docker容器中,覆盖原有配置文件

docker cp elasticsearch.yml  elastic770:/usr/share/elasticsearch/config

点击 http://127.0.0.1:9200  查看ES状态

 

5、安装可视化管理工具

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

打开 http://localhost:9800 。默认未连接,手工修改连接为 ` http://hd:9200`

Docker安装elasticsearch 7.7.0
            
    
    博客分类: jeecg