如何在Elastic Beanstalk中的Docker中增加ulimit? [英] How to increase ulimit in Docker in Elastic Beanstalk?

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

问题描述

我想在Elastic Beanstalk中增加Docker中的ulimit来运行一些应用程序.我知道我需要增加Docker主机的ulimit并重新启动docker服务,但是找不到解决方法.

I would like to increase ulimit in Docker in Elastic Beanstalk to run some apps. I know that I need to increase ulimit of Docker host and restart docker service but cannot find a way to do it.

我写了以下 .ebextensions/01limits.config ,但仍然不能增加ulimit.

I wrote following .ebextensions/01limits.config but still cannot increase ulimit.

commands:
  01limits:
    command: echo -e "#commands\nroot soft nofile 65536\nroot hard nofile 65536\n* soft nofile 65536\n* hard nofile 65536" >> /etc/security/limits.conf
  02restartdocker:
    command: service docker restart

添加2014-11-20 09:37 GMT

还尝试了以下配置文件.

Also tried with following config file.

commands:
  01limits:
    command: echo -e "#commands\nroot soft nofile 65536\nroot hard nofile 65536\n* soft nofile 65536\n* hard nofile 65536" >> /etc/security/limits.conf
  02restartdocker:
    command: service docker stop && ulimit -a 65536 && service docker start

它成功增加了ulimit,但在管理控制台中显示以下错误:

It successfully increased ulimit but showed following error in the management console:

[实例:i-xxxxxxxx模块:AWSEBAutoScalingGroup ConfigSet:空]实例上的命令失败.返回码:1输出:[CMD-AppDeploy/AppDeployStage1/AppDeployEnactHook/00flip.sh]命令失败,错误代码为1:/opt/elasticbeanstalk/hooks/appdeploy/enact/00flip.sh停止nginx:[OK]启动nginx:[确定]正在停止当前应用程序容器:1c ********** ...守护程序的错误响应:无法销毁容器1c **********:驱动程序devicemapper无法删除根文件系统1c ******************************************************************:设备正忙2014/11/20 09:06:36错误:无法删除一个或多个容器.

[Instance: i-xxxxxxxx Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: [CMD-AppDeploy/AppDeployStage1/AppDeployEnactHook/00flip.sh] command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/enact/00flip.sh Stopping nginx: [ OK ] Starting nginx: [ OK ] Stopping current app container: 1c**********... Error response from daemon: Cannot destroy container 1c**********: Driver devicemapper failed to remove root filesystem 1c**************************************************************: Device is Busy 2014/11/20 09:06:36 Error: failed to remove one or more containers.

我不确定此配置是否合适.

I am not sure this config is suitable.

推荐答案

这已经很晚了,但这是(希望)可以解决您的问题的方法

This is way late, but here's a (hopefully) working solution to your issue

initctl stop eb-docker && /sbin/service docker stop && ulimit -n 65536 && ulimit -c unlimited && export DMAP=$(df | grep /var/lib | awk '{print $1}') && if [[ $DMAP ]]; then umount $DMAP; fi && /sbin/service docker start && initctl start eb-docker

说明如下:

  • 停止docker容器服务
  • 停止docker服务
  • 应用您的ulimit设置(与您的设置不同)
  • 找到有问题的devicemapper安装并卸载(如果未安装,则处理)
  • 启动docker
  • 启动docker容器服务

这不是一个优雅的解决方案,但这就是围绕EB进行黑客攻击的生活.

It's not an elegant solution, but such is the life of hacking around EB.

您可能希望将其分解为较小的组件,但总的思路就在那里.

You might want to break it out into smaller components but the general idea is there.

这篇关于如何在Elastic Beanstalk中的Docker中增加ulimit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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