Docker info 查看报错 WARNING: No swap limit support 解决
docker可以通过启动命令来限制容器可以使用的最大物理内存和swap,但是通常在使用这些命令的时候经常会碰到“WARNING: No swap limit support”警告
大概意思就是不支持swap内存的限制,所以在使用,在国内的腾讯云和阿里云服务器上测试都是报这个警告的。
限制docker容器最大内存使用量
参数:-m 64M --memory-swap=128M
-m 64M 限制了容器运行可以使用的最大物理内存为64M,--memory-swap=128M限制容器可以使用的最大虚拟内存为128M,在出现WARNING: No swap limit support警告时这两个参数是无效的。
解决方法:
1、编辑/etc/default/grub文件。
在GRUB_CMDLINE_LINUX=" ",中并追加 cgroup_enable=memory swapaccount=1
yang@master:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration' GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
注:如果GRUB_CMDLINE_LINUX=内有内容,切记不可删除,只需在后面追加cgroup_enable=memory swapaccount=1并用空格和前面的内容分隔开。
2、保存,更新
yang@master:~$ sudo update-grub
3、重启服务器
yang@master:~$ sudo reboot
4、查看
yang@master:~$ docker info
Client:
Context: default
Debug Mode: false
Plugins:
.....
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Docker info 查看报错 WARNING: No swap limit support 解决的更多相关文章
- ubuntu中执行docker info出现警告信息WARNING: No memory limit support 或 WARNING: No swap limit support
docker info 指令报若下错误:WARNING: No memory limit support 或WARNING: No swap limit support 解决方法: 1.打开/etc/ ...
- egg 连接 mysql 的 docker 容器,报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client
egg 连接 mysql 的 docker 容器,报错:Client does not support authentication protocol requested by server; con ...
- Docker运行程序报错 WARNING: IPv4 forwarding is disabled. Networking will not work
WARNING: IPv4 forwarding is disabled. Networking will not work. 第一步:vi /usr/lib/sysctl.d/00-system ...
- docker info 警告"WARNING: No swap limit support"
vim/etc/default/grub 找到 GRUB_CMDLINE_LINUX="" 在双引号里面输入cgroup_enable=memory swapaccount=1 然 ...
- centos 6.5安装docker报错(查看报错详细信息--推荐)
(1)yum安装docker [root@namenode ~]# yum install docker-io (2)启动docker [root@namenode ~]# /etc/init.d/d ...
- Docker报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
问题:创建容器的时候报错WARNING: IPv4 forwarding is disabled. Networking will not work. # docker run -it -p 3000 ...
- (TODO:)下载图片,报错:warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.
想使用NSInvocationOperation下载图片,然而并没有下载下来, NSData为nil, 还有报错:(打断点就报错) warning: could not load any Object ...
- ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE
ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE 打开 /app/base/lib/application/dbtable.php , 替换A ...
- zun 不能创建 docker 容器,报错: datastore for scope "global" is not initialized
问题:zun不能创建docker容器,报错:datastore for scope "global" is not initialized 解决:修改docker 服务配置文件 ...
- 【mysql报错】MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”
MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”在命令行使用密码不安全警 ...
随机推荐
- 一种改进后的turf.idw算法
turf 是Advanced geospatial analysis geojson data in javascript. 官网:http://turfjs.org/ 针对github 中的源码. ...
- spring mvc问题:源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示
HTTP状态 404 - 未找到 类型 状态报告 描述 源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示. 我的问题:spring mvc无法访问到映射的controller,页面显 ...
- ES关闭打开索引
转载: https://mp.weixin.qq.com/s?__biz=MzAxMjY5NDU2Ng==&mid=2651862931&idx=1&sn=5834af8065 ...
- 【java】MVC模式和三层架构
MVC是一种分层开发的模式 M:Model,业务模型,处理业务,存储数据,获取数据.JavaBean对象 V: View , 视图,界面展示,展示数据.JSP或HTML C: Controller, ...
- Mint UI中的坑:datetime-picker在PC浏览器上可以显示弹出的日期选择,但是在手机上是空白
在网上搜了一下,发现,在根组件App.vue上写入这个就可以了
- 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的互转
/**火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的互转 * Created by macremote on 16/5/3. */ function GPSUtil (){ v ...
- synchronized与CAS
参考:java3y<对线面试官> synchronized synchronized是⼀种互斥锁,⼀次只能允许⼀个线程进⼊被锁住的代码块synchronized是Java的⼀个关键字,它能 ...
- 力扣51. N 皇后(回溯法)
按照国际象棋的规则,皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子. n 皇后问题 研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击. 给你一个整数 n ,返回 ...
- redis分布锁
1.redis分布式锁应用的场景? 1)防止缓存穿透:热点数据过期,大量线程访问mysql 2) 防止秒杀超卖:库存数量同步给redis后,对redis数据进行扣减 3)双写一致性:缓存的数据,被修 ...
- SpringCloud-Study
SpringCloud-Study 一.微服务简介 1.单体架构和分布式架构 单体架构 分布式架构 分布式架构的问题 解决方案 小结 2.微服务 微服务技术 微服技术对比 3.SpringCloud ...