如何增加 AWS ECS fargate 中的 vm.max_map_count? [英] How to increase the vm.max_map_count in AWS ECS fargate?

查看:22
本文介绍了如何增加 AWS ECS fargate 中的 vm.max_map_count?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 AWS fargate 平台上运行 sonarqube 应用程序.当我运行原始 docker 图像时,它就像一个魅力.但是,如果我将 JDBC 属性作为参数传递给容器,我将面临以下问题.显然,弹性搜索需要一个新的配置.如果它是 ECS 集群,我将通过 ssh 进入 EC2 实例并更新这些属性.在fargate的情况下,我该如何实现?

max virtual memory area vm.max_map_count [65530] 太低,至少增加到 [262144]

解决方案

从 github 的问题看来是不可能的,因为 Fargate 中没有 EC2 实例或 Host ivolvole.

<块引用>

max_map_count 错误的解决方法似乎是直接在主机上设置 max_memory_map(这可能会导致不良副作用,或者在 docker 上使用 sysctl 标志run 命令.很遗憾,Fargate 不支持这两个选项,因为它涉及与容器实例本身的交互.

但另一种方法是增加文件限制并禁用mmap检查.

我必须正确配置我的 ECS 任务定义的 U 限制,例如:超限":[{名称":无文件",软限制":65535,硬限制":65535}]

<块引用>

我在 ElasticSearch 中禁用了 mmap,从而摆脱了 max_map_count 设置要求.这可以通过配置 sonar.search.javaAdditionalOpts SonarQube 设置来完成.我无法使用环境变量来执行此操作,因为 ECS 似乎正在吃掉它们,但最后我只是将它作为参数传递给容器,因为入口点已设置并正确使用参数,所以它可以工作.就我而言:

命令":[-Dsonar.search.javaAdditionalOpts=-Dnode.store.allow_mmapfs=false"]

sonarqube 禁用 nmap

I am trying to run a sonarqube app on the AWS fargate platform. When I run the raw docker image it works like a charm. But If I pass the JDBC properties to the container as an argument I am facing the following issue. Apparently, the elastic search needs a new config. If it is an ECS cluster I would have ssh into the EC2 instances and update these properties. In the case of fargate, how do I achieve this?

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方案

From the github issue seems like it not possible as there is no EC2 instance or Host ivolvole in Fargate.

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.

But the other way is to increase file limit and disable mmap check.

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

这篇关于如何增加 AWS ECS fargate 中的 vm.max_map_count?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆