gpt4 book ai didi

amazon-web-services - 如何增加 AWS ECS fargate 中的 vm.max_map_count?

转载 作者:行者123 更新时间:2023-12-03 00:45:23 25 4
gpt4 key购买 nike

我正在尝试在 AWS fargate 平台上运行 sonarqube 应用程序。当我运行原始 docker 图像时,它就像一个魅力。但是如果我将 JDBC 属性作为参数传递给容器,我将面临以下问题。显然, Elasticsearch 需要一个新的配置。如果是 ECS 集群,我会将 ssh 连接到 EC2 实例并更新这些属性。在 fargate 的情况下,我如何实现这一目标? max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

最佳答案

从 github 问题来看似乎不可能,因为 Fargate 中没有 EC2 实例或 Host ivolvole。

the workarounds for the max_map_count error appear to be setting max_memory_map directly on the host (which may result in undesirable side effects, or using the sysctl flag on on the docker run command. Unfortunately, neither of these options are not supported in Fargate since it involves interacting with the container instance itself.


但另一种方式是增加 file limit并禁用 mmap查看。
I had to properly configure U limits on my ECS task definition, something like:
"ulimits": [
{
"name": "nofile",
"softLimit": 65535,
"hardLimit": 65535
}
]

I've disabled mmap in ElasticSearch, which gets rid of the max_map_count setting requirement. This can be done by configuring the sonar.search.javaAdditionalOpts SonarQube setting. I wasn't able to do it with an environment variable since ECS seems to be eating them, but in the end I just passed it as a parameter to the container, which works since the entrypoint is set and consumes arguments properly. In my case:

"command": [
"-Dsonar.search.javaAdditionalOpts=-Dnode.store.allow_mmapfs=false"
]
sonarqube disable nmap

关于amazon-web-services - 如何增加 AWS ECS fargate 中的 vm.max_map_count?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62860516/

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