gpt4 book ai didi

elasticsearch - docker - 麋鹿 - vm.max_map_count

转载 作者:IT老高 更新时间:2023-10-28 12:45:41 24 4
gpt4 key购买 nike

我正在尝试使用 Docker Compose 来使用 docker 的图像 elk-docker (https://elk-docker.readthedocs.io/)。 .yml 文件,是这样的:

elk:
image: sebp/elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"

当我运行命令:sudo docker-compose up,控制台显示:

* Starting Elasticsearch Server
sysctl: setting key "vm.max_map_count": Read-only file system
...fail!
waiting for Elasticsearch to be up (1/30)
waiting for Elasticsearch to be up (2/30)
waiting for Elasticsearch to be up (3/30)
waiting for Elasticsearch to be up (4/30)
waiting for Elasticsearch to be up (5/30)
waiting for Elasticsearch to be up (6/30)
waiting for Elasticsearch to be up (7/30)
waiting for Elasticsearch to be up (8/30)
waiting for Elasticsearch to be up (9/30)
waiting for Elasticsearch to be up (10/30)
waiting for Elasticsearch to be up (11/30)
waiting for Elasticsearch to be up (12/30)
waiting for Elasticsearch to be up (13/30)
waiting for Elasticsearch to be up (14/30)
waiting for Elasticsearch to be up (15/30)
waiting for Elasticsearch to be up (16/30)
waiting for Elasticsearch to be up (17/30)
waiting for Elasticsearch to be up (18/30)
waiting for Elasticsearch to be up (19/30)
waiting for Elasticsearch to be up (20/30)
waiting for Elasticsearch to be up (21/30)
waiting for Elasticsearch to be up (22/30)
waiting for Elasticsearch to be up (23/30)
waiting for Elasticsearch to be up (24/30)
waiting for Elasticsearch to be up (25/30)
waiting for Elasticsearch to be up (26/30)
waiting for Elasticsearch to be up (27/30)
waiting for Elasticsearch to be up (28/30)
waiting for Elasticsearch to be up (29/30)
waiting for Elasticsearch to be up (30/30)
Couln't start Elasticsearch. Exiting.
Elasticsearch log follows below.
cat: /var/log/elasticsearch/elasticsearch.log: No such file or directory
docker_elk_1 exited with code 1

我该如何解决这个问题?

最佳答案

您可以通过两种方式做到这一点。

  1. 临时设置 max_map_count:
    • sudo sysctl -w vm.max_map_count=262144
      但这只会持续到您重新启动系统。
  2. 永久性
    • 在您的主机中
      • vi/etc/sysctl.conf
      • 进入vm.max_map_count=262144
      • 重启

关于elasticsearch - docker - 麋鹿 - vm.max_map_count,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41064572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com