{"id":1460,"date":"2016-11-21T10:26:53","date_gmt":"2016-11-21T02:26:53","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=1460"},"modified":"2016-11-21T10:26:53","modified_gmt":"2016-11-21T02:26:53","slug":"linux-mysql%e6%8a%a5%ef%bc%9atoo-many-open-files%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/linux-mysql%e6%8a%a5%ef%bc%9atoo-many-open-files%e9%94%99%e8%af%af\/","title":{"rendered":"Linux-mysql\u62a5\uff1aToo many open files\u9519\u8bef"},"content":{"rendered":"<p>\u95ee\u9898\uff1a<\/p>\n<p>Linux\u6570\u636e\u5e93\u5f02\u5e38\uff0c\u603b\u662f\u81ea\u52a8\u505c\u6b62\uff0c\u91cd\u542f\u540e\u76f8\u96941-2\u5206\u949f\u5c31\u4f1a\u505c\u6b62.<\/p>\n<p>\u67e5\u770b\u6570\u636e\u5e93\u65e5\u5fd7\u663e\u793a\uff1a<\/p>\n<p>[ERROR] \/usr\/sbin\/mysqld: Can&#8217;t open file: &#8216;.\/eximstats\/smtp.frm&#8217; (errno: 24 &#8211; Too many open files)<\/p>\n<p>\u5927\u91cf\u5173\u4e8eeximstats\u6570\u636e\u5e93\u76f8\u5173\u7684\u9519\u8bef\u63d0\u793a.<\/p>\n<p>&nbsp;<\/p>\n<p>\u521d\u6b21\uff0c\u8ba4\u4e3a\u4e3a\u8be5\u6570\u636e\u5e93\u8868\u5b58\u5728\u95ee\u9898\uff0c\u5c1d\u8bd5\u4fee\u590d\u8be5\u6570\u636e\u5e93.<\/p>\n<p>\u4fee\u590d\u65b9\u5f0f\uff1a<\/p>\n<p>&lt;1&gt;\u767b\u5f55phpmyadmin \u8fdb\u884c\u4fee\u590d<\/p>\n<p>&lt;2&gt;\u547d\u4ee4\u4fee\u590d mysqlcheck -r eximstats<\/p>\n<p>&lt;3&gt;\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u4fee\u590d\u5168\u90e8\u6570\u636e\u5e93 mysqlcheck &#8211;all-databases -r<\/p>\n<p>\u4fee\u590d\u6210\u529f\u540e\uff0c\u91cd\u542fmysql\uff0c\u53d1\u73b0\u95ee\u9898\u4f9d\u7136\u5b58\u5728.<\/p>\n<p>&nbsp;<\/p>\n<p>\u7ecf\u641c\u7d22\u540e\uff0c\u6211\u53d1\u73b0\uff0c\u8fd9\u4e2a\u95ee\u9898\u53ef\u80fd\u662f\u7531\u4e8e\u6253\u5f00\u7684\u6587\u4ef6\u9650\u5236\u4e0d\u591f\u9ad8.<\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u6587\u4ef6\u9650\u5236\uff1a<\/p>\n<p>mysql&gt; SHOW VARIABLES LIKE &#8216;open_files_limit&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>| Variable_name \u00a0\u00a0\u00a0| Value |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>| open_files_limit | 5000 |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<p>&nbsp;<\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u6b63\u6253\u5f00\u7684\u6587\u4ef6\u6570\uff1a<\/p>\n<p>mysql&gt; SHOW GLOBAL STATUS LIKE &#8216;Open_files&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>| Variable_name | Value |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>| Open_files \u00a0\u00a0\u00a0| 3338 \u00a0|<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ece\u4e0a\u8ff0\u7ed3\u679c\u770b\uff0c\u6211\u76ee\u524d\u6253\u5f00\u7684\u6587\u4ef6\u672a\u8d85\u8fc7\u5f53\u524d\u6587\u4ef6\u9650\u5236.\u56e0\u4e3a\u76ee\u524dmysql\u8fd0\u884c\u65f6\u6b63\u5e38\uff0c\u4f46\u662f\u7ecf\u89c2\u5bdf\u6bcf\u6b21\u91cd\u542fmysql\u540e\uff0c\u76f8\u96941-2\u5206\u949fmysql\u5c31\u4f1a\u51fa\u73b0\u505c\u6b62\u8fd0\u884c\uff0c\u6211\u4eec\u4e5f\u65e0\u6cd5\u67e5\u770b\u76f8\u5173\u53c2\u6570.<\/p>\n<p>\u5c1d\u8bd5\u4e0a\u8c03mysql\u6587\u4ef6\u9650\u5236\uff1a<\/p>\n<p>\/etc\/my.cnf<\/p>\n<p>\u6dfb\u52a0\u6216\u4fee\u6539\uff1a<\/p>\n<p>open_files_limit=50000<\/p>\n<p>\u518d\u6b21\u91cd\u542fmysql<\/p>\n<p>&nbsp;<\/p>\n<p>\u7ee7\u7eed\u89c2\u5bdf\uff0c\u672a\u518d\u6b21\u51fa\u73b0\u4ee5\u4e0a\u5f02\u5e38.<\/p>\n<p>&nbsp;<\/p>\n<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.th7.cn\/db\/mysql\/201503\/93877.shtml<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\uff1a Linux\u6570\u636e\u5e93\u5f02\u5e38\uff0c\u603b\u662f\u81ea\u52a8\u505c\u6b62\uff0c\u91cd\u542f\u540e\u76f8\u96941-2\u5206\u949f\u5c31\u4f1a\u505c\u6b62. \u67e5\u770b\u6570\u636e\u5e93\u65e5\u5fd7\u663e\u793a\uff1a [ERROR &#8230; <a title=\"Linux-mysql\u62a5\uff1aToo many open files\u9519\u8bef\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/linux-mysql%e6%8a%a5%ef%bc%9atoo-many-open-files%e9%94%99%e8%af%af\/\" aria-label=\"\u9605\u8bfb Linux-mysql\u62a5\uff1aToo many open files\u9519\u8bef\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,49],"tags":[38,45],"class_list":["post-1460","post","type-post","status-publish","format-standard","hentry","category-hemanual","category-linux","tag-linux","tag-mysql"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=1460"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1460\/revisions"}],"predecessor-version":[{"id":1461,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1460\/revisions\/1461"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=1460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=1460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=1460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}