Docker安装es7.7.0和ik分词器,elasticsearch-head

1,下载镜像文件

创建docker网络

>docker network create -d bridge docker-net

>docker pull elasticsearch:7.7.0

运行容器

> docker run --network docker-net -d --name es -e "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" -e "discovery.type=single-node" -v G:\develop\docker\elasticsearch\data:/usr/local/elasticsearch/data -v G:\develop\docker\elasticsearch\plugins:/usr/local/elasticsearch/plugins  -v G:\develop\docker\elasticsearch\temp:/usr/temp --privileged -p 9200:9200 -p 9300:9300 elasticsearch:7.7.0

进入容器下载ik分词插件

>docker exec -it es bash

>cd plugins/
 
>mkdir ik
 
>cd ik
 
>yum -y install wget
  
>wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip
  
解压
  
>unzip elasticsearch-analysis-ik-7.7.0.zip
   
删除zip
   
>rm -rf elasticsearch-analysis-ik-7.7.0.zip


退出重启生效

2,设置密码访问

>docker exec -it es /bin/bash

>vi config/elasticsearch.yml

配置内容如下

```linux
cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
```


>/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive

输入密码


3,拉取镜像elasticsearch-head

>docker pull mobz/elasticsearch-head:5


运行容器
>docker run --network docker-net -d --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5

访问
>http://127.0.0.1:9100/?auth_user=elastic&auth_password=*****

修改Vendor.js文件第6886、7574行,将"application/x-www-from-urlencodes"修改为"application/json;charset=UTF-8"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值