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

相关推荐
shandianchengzi7 小时前
【记录】Tailscale|部署 Tailscale 到 linux 主机或 Docker 上
linux·运维·docker·tailscale
肉肉心很软9 小时前
使用onlyoffice实现文件预览编辑 + Docker一键部署流程
运维·docker·容器
-大头.9 小时前
Docker实战:构建高性能MySQL主从复制集群(读写分离)
mysql·docker·容器
LuiChun9 小时前
Docker Compose 容器服务查询与文件查看操作指南(Windows Docker Desktop 版)【一】
linux·运维·windows·docker·容器
goodlook012310 小时前
安装最新版本docker-26.1.4
运维·docker·容器
❀͜͡傀儡师10 小时前
docker安装部署PostgreSQL带有pgvector扩展向量数据(高维数组)
docker·postgresql·容器·pgvector
IT_Octopus11 小时前
Docker 镜像打的包有1.3个G 多阶段构建缩小镜像体积(不算成功)
运维·docker·容器
陈陈CHENCHEN12 小时前
【Kubernetes】镜像拉取密钥 - Docker Registry
docker·kubernetes
Bits to Atoms12 小时前
宇树机器人二次开发环境配置 -- docker创建
运维·docker·容器
码农小卡拉15 小时前
Docker Compose部署EMQX集群详细教程(Ubuntu环境优化版)
mqtt·ubuntu·docker·容器·emqx