elasticsearch/config/
elasticsearch/data/
elasticsearch/plugins/
network.bind_host: 0.0.0.0 #外网可访问
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
# xpack.security.enabled: true # 这条配置表示开启xpack认证机制 spring boot连接使用
xpack.security.transport.ssl.enabled: true
xpack.security.enabled: false
docker network create -d es-net
docker run -p 9200:9200 -p 9300:9300 --name elasticsearch \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-v /opt/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /opt/elasticsearch/data:/usr/share/elasticsearch/data \
-v /opt/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
--network es-net \
-d --privileged=true elasticsearch:7.8.0
-p:端口映射
-e discovery.type=single-node 单点模式启动
-e ES_JAVA_OPTS="-Xms84m -Xmx512m":设置启动占用的内存范围(实验环境启动后可能因为云服务器内存过小而占满) -v 目录挂载 -d 后台运行
"name" : "7cf5756f44f4",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "SFL5nHQJQz2F3ZwxM_R1mw",
"version" : {
"number" : "7.8.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "757314695644ea9a1dc2fecd26d1a43856725e65",
"build_date" : "2020-06-14T19:35:50.234439Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}