gpt4 book ai didi

amazon-web-services - AWS 容器服务 : set max_map_count

转载 作者:IT老高 更新时间:2023-10-28 21:37:50 24 4
gpt4 key购买 nike

我正在尝试在 AWS 容器服务上运行 Elasticsearch。这里是我关注的文档:https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod-mode

The vm_map_max_count setting should be set permanently in /etc/sysctl.conf:

$ grep vm.max_map_count /etc/sysctl.conf

vm.max_map_count=262144

To apply the setting on a live system type: sysctl -w vm.max_map_count=262144

有没有办法通过脚本设置 vm.max_map_count?我不想每次运行新容器时都手动进行。

谢谢

最佳答案

我找到了解决办法:

  1. 创建一个空容器
  2. 在之前的容器中启动 EC2:http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html
  3. 添加用户数据(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)如下:
#!/bin/bash
echo vm.max_map_count=262144 >> /etc/sysctl.conf
sysctl -w vm.max_map_count=262144

现在 EC2 实例已正确配置。

关于amazon-web-services - AWS 容器服务 : set max_map_count,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41792918/

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