Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2815257
  • 博文数量: 587
  • 博客积分: 6356
  • 博客等级: 准将
  • 技术积分: 6410
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-23 10:54
个人简介

器量大者,福泽必厚

文章分类

全部博文(587)

文章存档

2019年(3)

2018年(1)

2017年(29)

2016年(39)

2015年(66)

2014年(117)

2013年(136)

2012年(58)

2011年(34)

2010年(50)

2009年(38)

2008年(16)

分类: LINUX

2016-12-29 09:57:11

查看mysql日志发现有大量的这种错误

同时tomat日志里面有如下的日志:
2016-12-23 13:26:41,551 [Druid-ConnectionPool-Create-906657899] ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url: jdbc:mysql://*.*.*.*:3306/system?useUnicode=true&characterEncoding=utf-8&useSSL=true, errorCode 0, state 08S01


com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

at sun.reflect.GeneratedConstructorAccessor40.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)

at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988)

at com.mysql.jdbc.MysqlIO.(MysqlIO.java:341)

at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)

at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)

at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)

at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:806)

at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)

at sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source)

at

****

Caused by: java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)


查看mysql官方文档,有如下的解释:
B.5.2.11 Communication Errors and Aborted Connections

If connection problems occur such as communication errors or aborted connections, use these sources of information to diagnose problems:

If you start the server with the log_error_verbosity system variable set to 3, you might find messages like this in your error log:

[Note] Aborted connection 854 to db: 'employees' user: 'josh'

If a client is unable even to connect, the server increments the Aborted_connects status variable. Unsuccessful connection attempts can occur for the following reasons:

If these kinds of things happen, it might indicate that someone is trying to break into your server! If the general query log is enabled, messages for these types of problems are logged to it.

If a client successfully connects but later disconnects improperly or is terminated, the server increments the Aborted_clients status variable, and logs anAborted connection message to the error log. The cause can be any of the following:

Other reasons for problems with aborted connections or aborted clients:

  • The max_allowed_packet variable value is too small or queries require more memory than you have allocated for mysqld. See Section B.5.2.10, “Packet Too Large”.

  • Use of Ethernet protocol with Linux, both half and full duplex. Some Linux Ethernet drivers have this bug. You should test for this bug by transferring a huge file using FTP between the client and server machines. If a transfer goes in burst-pause-burst-pause mode, you are experiencing a Linux duplex syndrome. Switch the duplex mode for both your network card and hub/switch to either full duplex or to half duplex and test the results to determine the best setting.

  • A problem with the thread library that causes interrupts on reads.

  • Badly configured TCP/IP.

  • Faulty Ethernets, hubs, switches, cables, and so forth. This can be diagnosed properly only by replacing hardware.

按照说明:  我在线修改了max_allowed_packet 没有效果!
然后我将my.cnf中的
wait_timeout            = 100
interactive_timeout     = 100

注释掉,然后重启mysqld,这两个值就恢复成默认的设置了!问题就解决了。
 了
这样虽然解决问题了,但有很大的隐患!



阅读(12258) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~