docker run -it -p 9201:9200 --network elastic --name es2 elasticsearch:8.7.1
没有任何问题,几秒之后就会出现
✅ Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.
但是 docker-compose.yml
version: "3.9"
services:
logstash:
image: logstash:8.7.1
container_name: logstash
networks:
- elastic
ports:
- "5044:5044"
volumes:
- ./elk/pipeline:/usr/share/logstash/pipeline:rw,Z
restart: unless-stopped
depends_on:
- kibana
kibana:
image: kibana:8.7.1
container_name: kibana
networks:
- elastic
ports:
- "5601:5601"
restart: always
elasticsearch:
image: elasticsearch:8.7.1
container_name: elasticsearch
deploy:
resources:
reservations:
memory: 4GB
networks:
- elastic
ports:
- "9200:9200"
restart: no
networks:
elastic:
name: elastic
external: true
这样子启动的 elasticsearch 就会无限打印
{"@timestamp":"2023-06-02T12:25:51.290Z", "log.level": "WARN", "message":"received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.19.0.3:9200, remoteAddress=/172.19.0.2:42386}", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[bb66f54e0118][transport_worker][T#2]","log.logger":"org.elasticsearch.http.netty4.Netty4HttpServerTransport","elasticsearch.cluster.uuid":"7sT8niyaQeqs2oZAn8TLLg","elasticsearch.node.id":"jg-nmYbcQZmdM5Jfy_fMfw","elasticsearch.node.name":"bb66f54e0118","elasticsearch.cluster.name":"docker-cluster"}
然后几分钟后就ERROR: Elasticsearch exited unexpectedly,为什么,我无法理解了,还没有任何的 error 日志 它要是显示启动成功的那两个绿勾勾再无限打印 warning 也就算了,可是压根启动不成功
一开始我以为是 docker compose 启动过程中 kibana 不停给 elasticsearch 发 http 导致启动失败,但是 depends-on 完全不起作用,甚至我将 docker compose yml 删了只剩 elasticsearch 一个服务还是不行 但是 docker run ...就没有那串日志,所以难道 docker compose 在启动的时候,docker engine 不停给 elasticsearch 发什么 http 吗,healthcheck?? 这我该咋办啊
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.