Docker安装ElasticSearch/ES

目录

前言

  • TencentOS Server 3.1
  • Docker version 19.03.14, build 5eb3275d40

准备

  1. docker 已安装。

    安装 docker 参考:【Centos 8】【Centos 7】安装 docker

  2. 搜索可以使用的镜像。

    复制代码
    shell> docker search elasticsearch
    NAME                                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
    elasticsearch                            Elasticsearch is a powerful open source sear...   6115      [OK]       
    kibana                                   Kibana gives shape to any kind of data --- str...   2622      [OK]       
  3. 也可从docker hub上搜索镜像。
    docker hubdocker hub-stage

拉取ElasticSearch镜像

bash 复制代码
shell> docker pull elasticsearch:7.12.0
7.12.0: Pulling from library/elasticsearch
7a0437f04f83: Pull complete 
2b674c951ca3: Pull complete 
06baeb69f25f: Pull complete 
eeff01d19ce5: Pull complete 
a994306398ca: Pull complete 
2c002d76c1f6: Pull complete 
6286f2196f9b: Pull complete 
Digest: sha256:383e9fb572f3ca2fdef5ba2edb0dae2c467736af96aba2c193722aa0c08ca7ec
Status: Downloaded newer image for elasticsearch:7.12.0
docker.io/library/elasticsearch:7.12.0

安装ElasticSearch

  1. 创建并运行容器

    复制代码
    docker run --name elasticsearch1 -p 9200:9200  -p 9300:9300 \
    -e "discovery.type=single-node" \
    -e ES_JAVA_OPTS="-Xms84m -Xmx512m" \
    -d elasticsearch:7.12.0
  2. 检查是否安装成功

    浏览器访问http://localhost:9200, 如果出现以下界面就是安装成功:

拉取elasticsearch-head镜像

复制代码
docker pull mobz/elasticsearch-head:5

安装elasticsearch-head

  1. 创建容器

    复制代码
    docker create --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5
  2. 启动容器

    复制代码
    docker start elasticsearch-head
  3. 检查是否安装成功

    浏览器打开 http://localhost:9100, 如果出现以下界面就是安装成功:

参考

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

https://www.cnblogs.com/jianxuanbing/p/9410800.html

https://blog.csdn.net/teyue87/article/details/122626499

https://blog.csdn.net/qq_44732146/article/details/120744829

相关推荐
土豆丶杨1 小时前
centos 配置docker
docker·eureka·centos
杰哥的狗1 小时前
nacos连接失败,启动失败常见问题
linux·docker
DarkAthena2 小时前
【GaussDB】构建一个GaussDB的Docker镜像
数据库·docker·gaussdb
张火火isgudi6 小时前
CentOS8 使用 Docker 搭建 Jellyfin 家庭影音服务器
服务器·docker·容器
qq_447705317 小时前
宝塔通过docker部署JupyterHub指南【常见错误处理】
运维·docker·容器
tanxiaomi7 小时前
docker 从主机复制文件到容器外进行编辑
运维·docker·容器
hzulwy8 小时前
docker与k8s的容器数据卷
docker·eureka·kubernetes
coder_lorraine8 小时前
【Docker系列】Docker镜像探秘:打开容器世界的藏宝图
docker
codebetter8 小时前
Windows子系统WSL Ubuntu24.04 Docker pull镜像失败
windows·docker
飞询8 小时前
Window 部署 coze-stdio(coze 开发平台)
docker·github·coze