`
阿尔萨斯
  • 浏览: 4198839 次
社区版块
存档分类
最新评论

解决MySQL出现大量unauthenticated user的问题

 
阅读更多

最近发现两台MySQL server在中午的时候忽然(很突然的那种)发飙,不断的挂掉。重启mysql也尽是失败,看mysql的errorlog,只能看到类似如下的信息:

Forcing close of thread 12232 user: 'root'

用mysqladmin 简单的监控了下mysql的情况:

mysqladmin -uroot -p******** status -i 1

发现Queries per second avg只有200左右,可以说很低,但是Threads 确非常不稳定,居然会瞬间升级200以上,一般情况下这个线程这个值都是不会高于5的个位数!

然后继续看

mysqladmin -uroot -p******** processlist

居然有大量的unauthenticated user?? 如下情况

+------+-----------+---------+----+---------+------+-------+------------------+
[root@app028 ~]# mysqladmin -uroot -p************ processlist
+------+-----------+---------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+------+-----------+---------+----+---------+------+-------+------------------+
| 2007 | unauthenticated user | 192.168.4.29:58519 | | Connect | | login | |
| 2008 | unauthenticated user | 192.168.4.29:58553 | | Connect | | login | |
| 2009 | unauthenticated user | 192.168.4.29:58571 | | Connect | | login | |
| 2010 | unauthenticated user | 192.168.4.29:58577 | | Connect | | login | |
| 2011 | unauthenticated user | 192.168.4.29:58579 | | Connect | | login | |
| 2012 | unauthenticated user | 192.168.4.29:58589 | | Connect | | login | |

google了一下,

发现这算属MySQL的一个bug,不管连接是通过hosts还是ip的方式,MySQL都会对DNS做反查,IP到DNS,由于反查的接续速度过慢(不管是不是isp提供的dns服务器的问题或者其他原因),大量的查询就难以应付,线程不够用就使劲增加线程,但是却得不到释放,所以MySQL会“假死”。

解决的方案很简单,结束这个反查的过程,禁止任何解析。

打开mysql的配置文件(my.cnf),在[mysqld]下面增加一行:

skip-name-resolve

重新载入配置文件或者重启MySQL服务即可。


分享到:
评论

相关推荐

    MySQL服务器性能优化.docx

    当你观察你的主机进程列表,发现大量 264084 " unauthenticated user " xxx.xxx.xxx.xxx " NULL " Connect " NULL " login " NULL 的待连接进程时,就要加大 back_log 的值了。默认数值是50,我把它改为500。 (2)、...

    formio-upload-unauthenticated

    Form.io文件上传服务器该库提供了一个上载服务器/代理,可与Form.io文件组件和URL配置一起使用。 Form.io的MIT官方许可工作的此变体适用于开放源代码form.io。 这是一个未经授权的上传处理程序,因此它应与form.io的...

    speakeasy:由Bodyguard提供支持的基于中间件的苦艾酒GraphQL授权

    user_key: :current_user , # the key the current user will be under in the GraphQL context authn_error_message: :unauthenticated # default authentication failure message 注意:未提供authz_e

    glcic:Keras实施的“全球和本地一致的图像完成”

    全球和本地一致的图像完成(GLCIC) Keras实现了GLCIC,这是一...apt-get install -y --allow-unauthenticated python-opencv apt-get install -y --allow-unauthenticated vim apt-get install -y --allow-unauthent

    linux_screenshot_xwindows:波动插件从内存转储中提取X屏幕截图

    介绍 该易失性插件的目标是从内存转储中提取所有打开的X窗口的屏幕截图。 之前的工作 由Adam Bridge( )实现的linux_xwindows性插件linux_xwindows从注册到X的窗口对象中提取各种元数据,这些元数据是通过遍历X...

    SAL9000:SAL 9000于2021年3月16日在CTO Slackers上引起了轰动

    瑞克 howto: : 部署到Google CLoud本地-从仓库根目录运行:gcloud函数部署keyphraseExtraction-运行时python39 --trigger-http --allow-unauthenticated --project = sal9000-307923 --region = us-west2 从github...

    BSD-Asterisk:在FreeBSD中创建一个星号VoIP服务器

    BSD星号 在FreeBSD中创建一个星号VoIP服务器 ...context=unauthenticated ; default context for incoming calls allowguest=no ; disable unauthenticated calls srvlookup=yes ; enabled DNS SRV record looku

    flexdecrypt:解密iOS应用和Mach-O二进制文件

    如果您使用的是iOS 12.1或更低版本,请直接使用dpkg并收到错误消息,您可能需要使用以下方法解决依赖项: apt-get -f -y --allow-unauthenticated install 最新版本还包括flexdecrypt二进制文件,以备您自己安装。 ...

    tfjs-cloudrun

    在Cloud Run上使用TensorFlow.js服务保存的模型 使用通过Cloud Run为保存的模型提供预测。... --allow-unauthenticated \ --memory=1Gi \ --max-instances=10 \ --concurrency=10 \ --port=8080 \ --source=.

    github:Github API的高级包装。 适用于浏览器

    维护者想要 Github.js Github.js为Github的API提供了最小的高级包装。...// unauthenticated client const gh = new GitHub ( ) ; let gist = gh . getGist ( ) ; // not a gist yet gist . create ( {

    metrikfy_metrics:展开为米特里卡

    GCLOUD运行建立图像docker ...flow-290316/random查看图片gcloud container images list部署gcloud run deploy random --port 80 --platform=managed --allow-unauthenticated --region=us-central1 --image=gcr.io/s

    CVE-2021-21972:CVE-2021-21972 VMware vCenter metasploit利用脚本中的未经授权的RCE

    CVE-2021-21972 CVE-2021-21972 VMware ...chmod +x ~ /.msf4/modules/exploits/multi/http/vmware_vcenter_server_unauthenticated_file_upload_exploit.py msfconsole metasploit用法 set target set PAYLOAD

    rdio-node:Node.js 的 Rdio API 客户端库

    更新 2014-02-01 :Rdio 现在有一个官方的 Node.js 客户端库,可以在找到。 此 repo 中的库不再维护,此处用于存档目的。无线节点Rdio-Node 是 Node.js 的 Rdio API 客户端库。...// Make an unauthenticated

    dizzyapi-py:Dizzyam.com API的Python客户端

    用法实例化连接对象并调用其方法: from dizzyapi import JSONAPIConn , XMLAPIConn , APIError# Unauthenticated JSON connection# API results are returned as Python dictionariesjson_conn = JSONAPIConn ()...

    rik-nodejs-loopback-chat-server

    http://:@:会议室ACL片段: { "accessType": "WRITE", "principalType": "ROLE", "principalId": "$unauthenticated", "permission": "DENY", "property": [ "__create__messages", "__delete__messages", "__...

    opds2-search:索引器微服务

    opds2搜索微服务索引器微服务 本地快速入门npm运行开始 gcloud函数部署索引器--runtime nodejs14 --trigger-http --allow-unauthenticated

    dizzyapi-php:Dizzyjam.com APIPHP客户端

    # Sample unauthenticated call $ api = new Dizzyjam (); $ store_info = $ api -> catalogue -> store_info ( 'dizzyjam' ); # Add authentication $ api -> set_credentials ( $ auth_id , $

    burp-unauth-checker:burpsuite扩展程序,用于检查未经授权的漏洞

    burp-unauth-checker概述自动化检测未...一些授权参数是在get/post参数中的,如user/list?token=xxx,这时可以勾选replace GET/POST Auth Params with替换授权参数值。默认过滤后缀列表filterSuffixList = "jpg,jpeg,pn

    GCloudJsonToCsv:一个简单的GCloud函数,它接受json负载并返回excel文件

    -runtime dotnet3 --trigger-http --allow-unauthenticated 注意:这将允许任何人使用您的功能,因此请小心避免潜在的滥用跑注意:不要忘记将云功能端点放在索引文件的第11行(index.fsx:11) 一旦部署了功能运行...

    netlint:对网络配置文件执行静态分析

    注意:仍处于积极开发中,并可能会进行重大更改-使用此功能时请记住这一点。 Netlint 对网络设备配置文件执行...A101 Console line unauthenticated -> line con 0 A102 HTTP server not disabled -> ip http server -

Global site tag (gtag.js) - Google Analytics