[Warning] Buffered warning: Changed limits: max_connections: 214 (requested 2000)
来源:互联网 发布:2017淘宝进销存软件 编辑:程序博客网 时间:2024/06/11 17:03
1.版本
1)操作系统
cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
cat /proc/version
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014
2)mysql数据库版本
mysql --version
mysql Ver 14.14 Distrib 5.6.26, for linux-glibc2.5 (x86_64) using EditLine wrapper
2.问题描述
2.1 发现问题
今天在起我的测试环境库的时候,发现error log中出现如下告警:
mysqld_safe --defaults-file=/etc/my.cnf &
2016-01-08 09:37:38 28555 [Warning] Buffered warning: Could not increase number of max_open_files to more than 1024 (request: 10240)2016-01-08 09:37:38 28555 [Warning] Buffered warning: Changed limits: max_connections: 214 (requested 2000)2016-01-08 09:37:38 28555 [Warning] Buffered warning: Changed limits: table_open_cache: 400 (requested 2000)##在my.cnf文件中指定的open_files_limit=10240,max_connections指定的值为2000,table_open_cache未指定
2.2分析问题
下面我们来逐条分析一下 为什么会出现这三个告警:
2.2.1 关于max_open_files的告警
其实只要你了解mysql关于open_files_limit设置规则(open_files_limit值并不一定为你在配置文件中指定的值哦),那么这个问题就很清楚了。至于open_files_limit设置的详细内容请参见我的另一篇博客(http://blog.csdn.net/shaochenshuo/article/details/51966076)。本篇博客仅指出问题。此处的问题是我们操作系统层面的open files限制为1024
[root@localhost ~]# ulimit -Sa|grep "open files"open files (-n) 1024[root@localhost ~]# ulimit -Ha|grep "open files"open files (-n) 4096所以此处 open_files_limit就取了操作系统open files限制的值1024
2.2.2 关于max_connections 的告警
这个其实是mysql 5.6的一个bug,该bug详细内容请参见
https://bugs.mysql.com/bug.php?id=71821
或者
http://blog.csdn.net/shaochenshuo/article/details/50484475
当mysql发现操作系统的 open files或者mysql配置文件中open_files_limit的值设置的比较小的时候,mysql在启动的时候会自动调整max_connections的值。但是mysql的官方文档,和上面的bug中 都没有说到 这个调整是根据什么样的规则。
2.2.3 关于table_open_cache 的告警
该告警出现的原因同2.2.2(requested 2000 是因为 table_open_cache 的默认值是2000,因为我们在cnf文件中没有指定table_open_cache,所以取了默认值,但是又发现操作系统的open files限制太小,所以该参数自动调整为400)
3.解决方案
调整操作系统的open files限制
vi /etc/security/limits.conf
在最后加上
* soft nofile 655350
* hard nofile 655350
* hard nproc 655350
* soft nproc 655350
或者
mysql hard nofile 655350
mysql soft nofile 655350
mysql hard nproc 655350
mysql soft nproc 655350
##参考
http://blog.csdn.net/shaochenshuo/article/details/51966076
http://blog.csdn.net/shaochenshuo/article/details/50484475
- [Warning] Buffered warning: Changed limits: max_connections: 214 (requested 2000)
- ubuntu下mysql出现 warning: Changed limits: max_connections: 214 问题
- MySQL启动报“[Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 15000)”
- Changed limits: max_open_files: 2048 max_connections: 2038 table_cache: 64
- warning cpu has been changed !
- mysql提示Changed limits: max_open_files: 2048 max_connections: 1910 table_cache: 64解决办法
- Warning
- warning
- warning
- warning
- warning
- Warning
- Warning!!!
- Warning
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED解决方案
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- 有没有一种让人欲罢不能的学习方法?
- amplab实验室的SNAP算法运行和操作
- Php应聘技能要求
- python etl oracle导出 2
- 变量的左值和右值
- [Warning] Buffered warning: Changed limits: max_connections: 214 (requested 2000)
- Android asset文件夹和raw文件夹区别
- 采用webservice接口上传大文件
- tar 解压缩命令详解
- 15-oracle中的selectKey和sysdate
- VB.Net 关于类型关键字加方括号进行转义(Dim As [String])的总结
- 我这样做,请支持。
- Git之修改文件不能直接成功提交
- weka 使用命令行