elasticsearch配置docker :
received plaintext http traffic on an https channel, closing connection Netty4HttpChannel
是因为开启了 ssl 认证。
在 ES/config/elasticsearch.yml 文件中把 xpack.security.http.ssl:enabled 设置成 false 即可

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12


先docker run

docker run -d \
--name elasticsearch \
--privileged=true \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms128m -Xmx256m" \
elasticsearch:7.17.2

在复制文件:
docker cp elasticsearch:/usr/share/elasticsearch/config /mnt/d/Docker/docker_container_mount_data
docker cp elasticsearch:/usr/share/elasticsearch/data /mnt/d/Docker/docker_container_mount_data
docker cp elasticsearch:/usr/share/elasticsearch/plugins /mnt/d/Docker/docker_container_mount_data

最后docker run:
docker network create --subnet=172.20.0.0/24 elastic

docker run -d \
--name elasticsearch_one \
-p 9200:9200 \
-p 9300:9300 \
--ip=172.20.0.2 \
-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/config:/usr/share/elasticsearch/config \
-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
--privileged=true \
--net elastic \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
elasticsearch:7.17.2


-p 9200:9200 \
-p 9300:9300 \



-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/config:/usr/share/elasticsearch/config \
-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mnt/d/Docker/docker_container_mount_data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
创建kibana:

docker run \
--name kibana \
--net elastic \
--ip=172.20.0.3 \
-e "I18N_LOCALE=zh-CN" \
-p 5601:5601 \
-v /mnt/d/Docker/docker_container_mount_data/kibana/config:/usr/share/kibana/config \
-d kibana:7.17.2

docker cp
kibana:/usr/share/kibana/config
/mnt/d/Docker/docker_container_mount_data/kibana/config




nginx
docker run -d \
--net=elastic \
--ip=172.20.0.4 \
-p 80:80 \
-v /mnt/d/Docker/docker_container_mount_data/nginx/html:/usr/share/nginx/html \
-v /mnt/d/Docker/docker_container_mount_data/nginx/log/nginx:/var/log/nginx \
-v /mnt/d/Docker/docker_container_mount_data/nginx/etc/nginx:/etc/nginx \
--name=nginx \
nginx:stable

docker cp nginx:/usr/share/nginx/html /mnt/d/Docker/docker_container_mount_data/nginx
docker cp nginx:/var/log/nginx /mnt/d/Docker/docker_container_mount_data/nginx/log
docker cp nginx:/etc/nginx /mnt/d/Docker/docker_container_mount_data/nginx/etc