Docker安装ElasticSearch

安装步骤:
一、具备Docker环境

二、创建docker虚拟网络

三、拉取镜像

四、

五、docker-compose.yml安装
1.编写docker-compose.yml
version: '2.2'
services:

elasticsearch:
image: elasticsearch:7.17.10
container_name: es7
environment:
- node.name=es7
- cluster.name=es-cluster
- discovery.seed_hosts=es7
- cluster.initial_master_nodes=es7
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- /container/mnt/elk/elasticsearch/config:/usr/share/elasticsearch/config
- /container/mnt/elk/elasticsearch/data:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- elastic

2.配置 elasticsearch.yml
cluster.name: "docker-cluster"
network.host: 127.0.0.1

----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------

The following settings, TLS certificates, and keys have been automatically

generated to configure Elasticsearch security features on 12-10-2023 11:31:09

--------------------------------------------------------------------------------

Enable security features

xpack.security.enabled: false

xpack.security.enrollment.enabled: false

Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents

xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12

Enable encryption and mutual authentication between cluster nodes

xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12

----------------------- END SECURITY AUTO CONFIGURATION -------------------------

3.启动elastic search
docker compose up -d

posted on 2024-11-28 13:55  vello  阅读(9)  评论(0编辑  收藏  举报