诡异的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数据库中执行如 ...
随机推荐
- apache 配置https
1.生成密钥# openssl genrsa 1024 > server.key这是用128位rsa算法生成密钥,并保存到server.key文件 2.生成证书请求文件# openssl req ...
- Highcharts——大气好用的图标制作工具
Highcharts是一款纯javascript编写的图表库,能够很简单便捷的在Web网站或Web应用中添加交互性的图表,Highcharts目前支持直线图.曲线图.面积图.柱状图.饼图.散点图等多达 ...
- ios系统的中arm指令集
arm结构处理器,几乎所有的手机都基于arm,其在嵌入式系统中应用非常广泛. ARM 处理器因为低功耗和小尺寸而闻名,它的性能在同等功耗的产品中也很出色.这里我们注意一点,模拟器并不运行arm代码,软 ...
- Data Science at the Command Line学习笔记(二)
1.vagrant建立简单httpserver方法: 1)映射端口 修改Vagrantfile, 末尾添加本地端口和虚机端口的映射关系, 然后执行vagrant reload. Vagrant::Co ...
- JS-改变页面的颜色(二)
需求:点击页面的按钮,改变页面的颜色 思路:一先画出最简单的页面,二想办法获取页面的body节点,三想办法修改body节点的背景颜色属性,四通过一个方法获取随机的颜色值 和第一个例 ...
- express 4 中 session的处理(仅为博主笔记)
1.app.js var express = require('express') var app = express();var routers = require('./router/index' ...
- MyEclipse+Tomcat 启动时出现A configuration error occured during startup错误的解决方法
MyEclipse+Tomcat 启动时出现A configuration error occured during startup错误的解决方法 分类: javaweb2013-06-03 14:4 ...
- RichEdit
RichEdit 设置字符颜色 ; ; this->RichEdit1->SelAttributes->Color=clRed; 行间距字符间距 void __fastcall TF ...
- python基础知识---变量
一.变量是什么? python变量是对内存中一个数据结构的引用,用一个变量给另外一个变量赋值,那就有两个变量引用同一个数据结构(数字.字符串.列表.元组.字典.自定义对象等) 当一个数据结构的引用计数 ...
- 温习SQL server
做了好几年的管理工作,技术上有些退步,现在又一一捡起来啦, 以下最近几天看到的好文章, SQL Server约束 http://blog.csdn.net/qq61394323/article/det ...