赞
踩
先创建挂在目录
创建配置文件elasticsearch.yml
http.host: 0.0.0.0
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
http.port: 9202
#配置对外服务的http端口号
transport.tcp.port: 9302
#设置节点间交互的tcp端口,默认是9300。
运行一下命令
docker run --name elasticsearch7.10-prod -p 9202:9202 -p 9302:9302 -d --restart=always -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms1G -Xmx1G" --privileged=true -v /data/elasticsearch7.10-prod/data:/usr/share/elasticsearch/data -v /data/elasticsearch7.10-prod/plugins:/usr/share/elasticsearch/plugins -v /data/elasticsearch7.10-prod/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml elasticsearch:7.10.1
进入容器
docker exec -it elasticsearch7.10-prod /bin/bash
设置密码
bin/elasticsearch-setup-passwords interactive
设置好几个
ip:端口
输入密码登录成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。