docker安装elasticsearch

https://blog.csdn.net/qq_40942490/article/details/111594267

夕颜博客

https://gitee.com/bright-boy/xiyan-blog

拉取镜像

docker pull elasticsearch:7.7.0

启动镜像

docker run –name elasticsearch -d -e ES_JAVA_OPTS=”-Xms512m -Xmx512m” -e “discovery.type=single-node” -p 9200:9200 -p 9300:9300 elasticsearch:7.7.0

http://172.24.112.8:9200/

对外开放端口

firewall-cmd –permanent –zone=public –add-port=9300/tcp
firewall-cmd –permanent –zone=public –add-port=9200/tcp
firewall-cmd –permanent –zone=public –add-port=9100/tcp

开启防火墙

systemctl status firewalld

systemctl start firewalld

systemctl restart firewalld

参数说明

–name表示镜像启动后的容器名称

-d: 后台运行容器,并返回容器ID;

-e: 指定容器内的环境变量

-p: 指定端口映射,格式为:主机(宿主)端口:容器端口

文档更新时间: 2021-09-06 08:00   作者:admin