摘要:本文主要介绍在docker
环境下如何快速部署elasticsearch
单机版本和集群版本,和增加xpack
简单用户名密码配置。
镜像地址
单节点部署
登陆用户名
elastic
,密码:elastic@123
bootstrapPassword.txt
该文件保存的是密码
css
elastic@123
docker-compose.yml
yaml
version: '3'
services:
elasticsearch:
image: elasticsearch:7.12.0
container_name: elasticsearch
privileged: true
networks:
- default
ports:
- 9200:9200
- 9300:9300
environment:
discovery.type: single-node
cluster.name: elasticsearch
xpack.security.enabled: true
ELASTIC_PASSWORD_FILE: /run/secrets/bootstrapPassword.txt
volumes:
- "./data:/usr/share/elasticsearch/data"
- ./bootstrapPassword.txt:/run/secrets/bootstrapPassword.txt
networks:
default:
external:
name: huzhihui
运行
docker-compose up -d
- 出现下面日志表示部署成功
集群部署
文档:www.elastic.co/guide/en/el...
按照步骤来即可,简单的