es环境搭建是用的docker,下面是docker启动命令,搭建过程参考es书签里的文章,这个在linux系统里也有,在这只是记录一下
1.es docker启动
docker run \
--name es \
--privileged=true \
-p 9200:9200 \
-p 9300:9300 \
-v /mydata/elasticsearch/config:/usr/share/elasticsearch/config \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
--network=es-net \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-d elasticsearch:8.2.0
另一种挂载数据卷的写法:
es-data:/data:/usr/share/elasticsearch/data
es-plugins:/usr/share/elasticsearch/plugins \
2 kibana docker 启动
kibana
docker run \
--name kibana \
-e ELASTICSEARCH_HOST=http://es:9200 \
--network=es-net \
-p 5601:5601 \
-v /mydata/kibana/:/usr/share/kibana/config \
-d kibana:8.2.0
3 这个可能是一个修改的文件元文档
cluster.name: "docker-cluster"
network.host: 0.0.0.0
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically
# generated to configure Elasticsearch security features on 18-11-2023 13:48:42
#
# --------------------------------------------------------------------------------
# Enable security features
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
# 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 -------------------------
~