诡异的too manany connections报错
问题现象:
应用重启,日志里面报错too manany connections
问题分析:
线上该业务线应用全部重启,一个有38个应用,每个应用3台服务器,每台服务器启动5个链接:
num=38*3*5=570;
570<2048,我们默认的应用最大连接数是2048,怎么会报too manany connections错误。
查看配置文件/etc/my.cnf,确实是max_connections=2028;
登录数据库:
mysql> show variables like '%max%connection%';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| max_connections | 214 |
| max_user_connections | 0 |
+----------------------+-------+
2 rows in set (0.00 sec)
神奇的max_connetions 居然成了214,经排查并没有认为修改过该参数值。
[root@mysq-60-103 ~]# ps -ef|grep mysqld_safe
root 2676 1815 0 12:32 pts/0 00:00:00 grep mysqld_safe
mysql 23450 1 0 Oct10 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/mysql/data --pid-file=/mysql/data/mysql.pid
查看mysql实例启动进程,是使用mysql用户启动的,而在系统参数配置中,除mysql用户外,其它用户都限制了最大创建连接为1024.因为2048>1024
所以以mysql用户启动mysql实例时,会从默认值214开始分配,以至于max_connetions =214;
[root@mysql-zxzs-60-103 ~]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1024
root soft nproc unlimited
解决方式:
1、以root用户启动mysql实例;
2、向 /etc/security/limits.d/90-nproc.conf文件中追加如下参数:
mysql soft nproc 65535
mysql hard nproc 65535
使配置生效后,再已mysql用户启动mysql实例。
诡异的too manany connections报错的更多相关文章
- 解决:eclipse配置Database Connections报错Communications link failure Last packet sent to the server was 0 ms ago
网上各式各样的问题,不过我的问题在于我开了Proxifier,导致链接localhost的时候被拦截...把Proxifier关了就好了 以后遇到这种问题.连不上数据库啊,连不上本地的服务器啊,先检查 ...
- 报错Too many connections
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establish ...
- 【JDBC 报错】Connections could not be acquired from the underlying database!
项目启动报错: [2016-07-13 10:04:15,074] ERROR org.apache.ibatis.executor.BaseExecutor Could not get a data ...
- mongodb报错:connection refused because too many open connections: 819
问题: 发现mongodb无法连接,查看mongodb日志,出现大量的如下报错: [initandlisten] connection refused because too many open co ...
- Mysql:报错message from server: "Too many connections"(连接太多)
报错信息 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source re ...
- hive报错 Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections,
学习hive 使用mysql作为元数据 hive创建数据库和切换数据库都是可以的 但是创建表就是出问题 百度之后发现 是编码问题 特别记录一下~~~ 1.报错前如图: 2.在mysql数据库中执行如 ...
- jenkins centos slave起不来报错The SSH key presented by the remote host does not match the key saved in the Known Hosts file against this host. Connections to this host will be denied until the two keys mat
场景:我的centos-204是一台centos的机器,本来用https://www.cnblogs.com/zndxall/p/8297356.html 的centos slave方式搭建ok的,一 ...
- RDS 在线DDL诡异报错ERROR 1062 (23000): Duplicate entry
RDS上执行报错如下: MySQL [ad_billing]> ALTER TABLE ad_spending ADD COLUMN impr bigint(20) NOT NULL DEFAU ...
- hive 字符集问题 报错 Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections,
学习hive 使用mysql作为元数据 hive创建数据库和切换数据库都是可以的 但是创建表就是出问题 百度之后发现 是编码问题 特别记录一下~~~ 1.报错前如图: 2.在mysql数据库中执行如 ...
随机推荐
- E:in-range伪类选择器与E:out-of-range伪类选择器
E:in-range伪类选择器用来指定当元素的有效值被限定在一段范围之内(通常通过min属性值与max属性值来限定),且实际输入值在该范围内时使用的样式.E:out-of-range伪类选择器用来指定 ...
- tomcat下的https项目创建与部署
1.1 生成keystore文件及导出证书 步奏1:打开控制台,运行: %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (如果你已经 ...
- 伪静态URLRewrite学习笔记
UrlRewrite: UrlRewrite就是我们通常说的地址重写,用户得到的全部都是经过处理后的URL地址,类似于Apache的mod_rewrite.将我们的动态网页地址转化为静态的地址,如ht ...
- regular expressions
- C++ 类里面,函数占用存储空间问题
转载自:http://blog.163.com/xping_lsr/blog/static/19654034520119804131721/ 先看两段代码: 代码段1:class A{public:i ...
- linux上安装配置vsftpd
启动: /usr/sbin/vsftpd & 端口占用: lsof -i:21 位置: whereis vsftpd 默认配置下,匿名用户登录 vsftpd 服务后的根目录是 /var/ftp ...
- Django模板格式
变量 {{ 变量名称 }} 块 {% block 块名称 %} 判断 根据布尔值判断: {% if 布尔值 %} 操作 {% endif %} 根据两者是否相等判断: {% ifequals 变量1 ...
- Hibernate的配置文件以及用法
一. 三大框架 Hibernate 1.安装hibernate插件至ecilpse 2.进行配置 2.1 主配置文件 <?xml version="1.0" encoding ...
- Angular JS中 Promise用法
一.Promise形象讲解A promise不是angular首创的,作为一种编程模式,它出现在1976年,比js还要古老得多.promise全称是 Futures and promises. 而在j ...
- 【软件工程】用map 实现把英语文本文件词和个数打印出来
#include <iostream> #include <fstream> #include <string> #include <map> usin ...