{"id":5392,"date":"2020-07-30T00:13:17","date_gmt":"2020-07-29T16:13:17","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5392"},"modified":"2020-07-30T00:13:17","modified_gmt":"2020-07-29T16:13:17","slug":"mysql5-7%e5%ae%89%e8%a3%85%e6%8f%92%e4%bb%b6%e5%af%bc%e8%87%b4%e4%b8%bb%e5%ba%93hang%e4%bd%8f%e6%ad%bb%e9%94%81%e6%97%a0%e5%93%8d%e5%ba%94","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5392","title":{"rendered":"MySQL5.7\u5b89\u88c5\u63d2\u4ef6\u5bfc\u81f4\u4e3b\u5e93hang\u4f4f\u6b7b\u9501\u65e0\u54cd\u5e94"},"content":{"rendered":"<div>\n<div>\n\u4e00\u3001\u80cc\u666f\n<\/div>\n<\/div>\n<div>\n<div>\nMySQL 1\u4e3b2\u4ece\uff0c\u534a\u540c\u6b65\u590d\u5236\uff0c\u4e3b\u5e93\u6709\u8f83\u9ad8\u7684\u5199\u5165\u91cf\uff0c\u6b64\u65f6\u5728\u4e3b\u5e93\u91cd\u590d\u5b89\u88c5\u534a\u540c\u6b65\u63d2\u4ef6\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e3b\u5e93hang\u4f4f\uff0c\u65e0\u54cd\u5e94\uff0c\u53ea\u80fd\u901a\u8fc7\u91cd\u542f\u6570\u636e\u5e93\u6765\u6062\u590d\u3002<\/p>\n<h5>\u4e8c\u3001\u6545\u969c\u590d\u73b0<\/h5>\n<p>\u73af\u5883\uff1a<\/p>\n<ul>\n<li>MySQL\u7248\u672c\uff1aPercona Server for MySQL 5.7.19<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aRed Hat Enterprise Linux Server release 6.3<\/li>\n<\/ul>\n<p>\u590d\u5236\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u51c6\u5907\u73af\u5883MySQL 5.7.19 1\u4e3b2\u4ece\uff0c\u534a\u540c\u6b65\u590d\u5236\u4f7f\u7528<\/li>\n<li>sysbench\u5f80\u4e3b\u5e93\u5199\u6570\u636e<\/li>\n<li>\u5728\u4e3b\u5e93\u5faa\u73af\u6267\u884c\u5b89\u88c5\u534a\u540c\u6b65\u63d2\u4ef6\u547d\u4ee4\uff1a\n<ol>\n<li>INSTALL PLUGIN rpl_semi_sync_master SONAME \\&#8217;semisync_master.so\\&#8217;;<\/li>\n<li>INSTALL PLUGIN rpl_semi_sync_slave SONAME \\&#8217;semisync_slave.so\\&#8217;;<\/li>\n<\/ol>\n<\/li>\n<li>\u5728\u5e94\u7528\u673a\u5668\u4e0a\u8fde\u63a5\u5230\u4e3b\u5e93\uff0c\u591a\u7ebf\u7a0b\u5faa\u73af\u6267\u884c\uff1a\n<ol>\n<li>select @@session.tx_read_only<\/li>\n<\/ol>\n<\/li>\n<li>\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\uff0c\u590d\u73b0\u6545\u969c\u3002\n<ol>\n<li>\u4e3b\u5e93\u65e0\u6cd5\u8fde\u63a5\uff0c\u65e0\u54cd\u5e94<\/li>\n<li>\u4ece\u5e93Slave_IO_Running: Connecting<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h5>\u4e09\u3001\u539f\u56e0\u5206\u6790<\/h5>\n<p>\u901a\u8fc7\u5206\u6790MySQL\u6e90\u7801\uff0c\u5b89\u88c5\u534a\u540c\u6b65\u63d2\u4ef6\u8fc7\u7a0b\u4e2d\uff0c\u52a0\u9501\u91ca\u653e\u9501\u76f8\u5173\u7684\u6e90\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>\n\/\/sql\/sql_plugin.cc\nmysql_mutex_lock(&amp;LOCK_plugin);\nmysql_rwlock_wrlock(&amp;LOCK_system_variables_hash);\n\u2026\nif (plugin_find_internal(name_cstr, MYSQL_ANY_PLUGIN))\n  {\n    mysql_mutex_unlock(&amp;LOCK_plugin);\n    report_error(report, ER_UDF_EXISTS, name-&gt;str);\n    mysql_mutex_lock(&amp;LOCK_plugin);\n    DBUG_RETURN(TRUE);\n  }\n\u2026\nmysql_rwlock_unlock(&amp;LOCK_system_variables_hash);\nmysql_mutex_unlock(&amp;LOCK_plugin);\n<\/pre>\n<p>\u52a0\u9501\u987a\u5e8f\u4e3a\uff1a<\/p>\n<ol>\n<li>LOCK_plugin<\/li>\n<li>LOCK_system_variables_hash<\/li>\n<\/ol>\n<p>\u91ca\u653e\u9501\u7684\u987a\u5e8f\u4e3a\uff1a<\/p>\n<ol>\n<li>LOCK_system_variables_hash<\/li>\n<li>LOCK_plugin<\/li>\n<\/ol>\n<p>\u770b\u4e00\u4e0b\u5176\u4ed6\u7ebf\u7a0b\u6267\u884cselect @@session.tx_read_only \u65f6\u7684\u52a0\u9501\u987a\u5e8f\uff1a<\/p>\n<pre>mysql_mutex_lock(&amp;LOCK_plugin);\nmysql_rwlock_rdlock(&amp;LOCK_system_variables_hash);\n<\/pre>\n<ol>\n<li>LOCK_plugin<\/li>\n<li>LOCK_system_variables_hash<\/li>\n<\/ol>\n<p>\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u52a0\u9501\u91ca\u653e\u9501\u7684\u987a\u5e8f\u4e00\u81f4\uff0c\u5e94\u8be5\u4e0d\u4f1a\u53d1\u751f\u6b7b\u9501\u3002\u4f46\u662f\u5728\u534a\u540c\u6b65\u63d2\u4ef6\u5df2\u7ecf\u5b89\u88c5\u7684\u60c5\u51b5\u4e0b\uff0c\u4ee3\u7801\u903b\u8f91\u4f1a\u5148\u91ca\u653e\u9501 mysql_mutex_unlock(&amp;LOCK_plugin); \u7136\u540e\u62a5\u544a\u9519\u8bef\uff08report_error\uff09 \uff0c\u4e5f\u5c31\u662f\u5e38\u89c1\u5230\u7684 Function \\&#8217;rpl_semi_sync_master\\&#8217; already exists\uff0c \u4e4b\u540e\u518d\u52a0\u9501mysql_mutex_lock(&amp;LOCK_plugin);<br \/>\n\u8fd9\u4e2a\u91ca\u653e\u9501\uff0c\u62a5\u544a\u9519\u8bef\u4fe1\u606f\uff0c\u518d\u52a0\u9501\u7684\u95f4\u9699\uff0cLOCK_plugin \u53ef\u80fd\u4f1a\u88ab\u5176\u4ed6\u7ebf\u7a0b\u62ff\u5230\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>session1<\/th>\n<th>session2<\/th>\n<th>\u5907\u6ce8<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u83b7\u53d6\u9501 LOCK_plugin<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u83b7\u53d6\u9501 LOCK_system_variables_hash<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u53d1\u73b0\u63d2\u4ef6\u5df2\u5b89\u88c5\uff0c\u91ca\u653e\u9501LOCK_plugin<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>\u83b7\u53d6\u9501 LOCK_plugin<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>\u8bf7\u6c42LOCK_system_variables_hash<\/td>\n<td>\u7b49\u5f85<\/td>\n<\/tr>\n<tr>\n<td>\u8bf7\u6c42LOCK_plugin<\/td>\n<td><\/td>\n<td>\u7b49\u5f85<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td>\u6b7b\u9501\u53d1\u751f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6269\u5c55\u4e00\u4e0b\uff0c\u5b89\u88c5\u63d2\u4ef6\uff0c\u9664\u4e86\u63d2\u4ef6\u5df2\u7ecf\u5b58\u5728\u4e4b\u5916\uff0c\u65e0\u6cd5\u6253\u5f00\u52a8\u6001\u5e93\uff08Can\\&#8217;t open shared library\uff09\u548c \u52a8\u6001\u5e93\u65e0\u6cd5\u627e\u5230\u7b26\u53f7\u5165\u53e3\uff08Can\\&#8217;t find symbol in library\uff09\uff0c\u90fd\u6709\u53ef\u80fd\u4e0e\u4e1a\u52a1SQL\u4ea7\u751f\u6b7b\u9501\u3002\u5982\u4e0b\uff1a<\/p>\n<pre>mysql_mutex_unlock(&amp;LOCK_plugin);\nreport_error(report, ER_CANT_OPEN_LIBRARY, dl-&gt;str, 0, buf);\nmysql_mutex_lock(&amp;LOCK_plugin);\n<\/pre>\n<pre>mysql_mutex_unlock(&amp;LOCK_plugin);\nreport_error(report, ER_CANT_FIND_DL_ENTRY, name-&gt;str);\nmysql_mutex_lock(&amp;LOCK_plugin);\n<\/pre>\n<p>\u53e6\u5916\uff0c\u9664\u4e86\u534a\u540c\u6b65\u63d2\u4ef6\u5916\uff0c\u5176\u4ed6\u7684\u63d2\u4ef6\uff0c\u5982\u5ba1\u8ba1\u63d2\u4ef6\uff08Audit\uff09\u7b49\uff0c\u90fd\u6709\u53ef\u80fd\u4f1a\u89e6\u53d1\u6b7b\u9501\u3002<\/p>\n<hr \/>\n<p>\u6ce8\uff1a<br \/>\nPercona Server 5.7.25 \u5df2\u4fee\u590d\u8be5Bug\u3002\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u80cc\u666f MySQL 1\u4e3b2\u4ece\uff0c\u534a\u540c\u6b65\u590d\u5236\uff0c\u4e3b\u5e93\u6709\u8f83\u9ad8\u7684\u5199\u5165\u91cf\uff0c\u6b64\u65f6\u5728\u4e3b\u5e93\u91cd\u590d\u5b89\u88c5\u534a\u540c\u6b65\u63d2\u4ef6\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e3b\u5e93ha &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5392\"> <span class=\"screen-reader-text\">MySQL5.7\u5b89\u88c5\u63d2\u4ef6\u5bfc\u81f4\u4e3b\u5e93hang\u4f4f\u6b7b\u9501\u65e0\u54cd\u5e94<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"\u4e00\u3001\u80cc\u666f MySQL 1\u4e3b2\u4ece\uff0c\u534a\u540c\u6b65\u590d\u5236\uff0c\u4e3b\u5e93\u6709\u8f83\u9ad8\u7684\u5199\u5165\u91cf\uff0c\u6b64\u65f6\u5728\u4e3b\u5e93\u91cd\u590d\u5b89\u88c5\u534a\u540c\u6b65\u63d2\u4ef6\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e3b\u5e93ha&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5392"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5392"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5392\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}