update elastic docs

This commit is contained in:
2022-11-30 15:36:26 +08:00
parent cb9acfe1a0
commit 87c1dd945d
3 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# 集群名称
cluster.name: es-cluster
# 节点名称
node.name: es-node-1
# 绑定host0.0.0.0代表当前节点的ip
network.host: 0.0.0.0
# 是否支持跨域默认为false
http.cors.enabled: true
# 当设置允许跨域,默认为*,表示支持所有域名,如果我们只是允许某些网站能访问,那么可以使用正则表达式。
# 比如只允许本地地址。 /https?:\/\/localhost(:[0-9]+)?/
http.cors.allow-origin: "*"
# 初始化主节点
cluster.initial_master_nodes: ["es-node-1"] #本地只有一个节点,无法正常启动,先注释

19
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,19 @@
version: '3.9'
services:
elasticsearch:
image: elasticsearch:8.5.2
restart: always
hostname: kite.elasticsearch
container_name: elasticsearch
volumes:
- ./data:/usr/share/elasticsearch/data
- ./plugins:/usr/share/elasticsearch/plugins
- ./config/elasticsearch.yml:/config/elasticsearch.yml
environment:
- "ES_JAVA_OPTS=-Xms64m -Xmx512m"
- discovery.type=single-node
ports:
- '9200:9200' # 集群通信端口
- '9300:9300' # http业务通信端口
privileged: true # 环境变量