1.创建挂载文件夹目录并授权mkdir -p /opt/docker/elasticsearch/{conf,data,logs,plugins} sudo chmod -R 777 /opt/docker/elasticsearch/{conf,data,logs,plugins}2.在 /opt/docker/elasticsearch/conf 目录下根据版本编写 elasticsearch.yml 配置文件cluster.name: es-clusternode.name: node-1 node.master: true node.data: truenetwork.host: 0.0.0.0path.logs: /usr/share/elasticsearch/logs path.data: /usr/share/elasticsearch/databootstrap.memory_lock: truehttp.port: 9200 transport.tcp.port: 9300# discovery.seed_hosts: ["127.0.0.1"] -- docker 容器安装时IP不固定,使用 environment 指定为 服务名 cluster.initial_master_nodes: ["node-1"]action.destructive_requires_name: truehttp.cors.enabled: true http.cors.allow-origin: "*"xpack.security.enabled: false xpack.security.authc.api_key.enabled: false xpack.security.http.ssl.enabled: false xpack.security.transport.ssl.enabled: false