{"id":47262,"date":"2023-05-01T22:16:42","date_gmt":"2023-05-01T14:16:42","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=47262"},"modified":"2023-05-01T22:16:42","modified_gmt":"2023-05-01T14:16:42","slug":"percona-binary-install","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/percona-binary-install.html","title":{"rendered":"\u4e8c\u8fdb\u5236\u7248\u5b89\u88c5\u4ee5\u53ca\u542f\u52a8 Percona-5.7.15"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u672c\u6587\u5c06\u53d9\u8ff0\u901a\u8fc7\u4e8c\u8fdb\u5236\u6e90\u7801\u65b9\u5f0f\u5b89\u88c5Percona-5.7.15\uff0c\u5e76\u8fdb\u884c\u5feb\u901f\u542f\u52a8\u3002\u8fd9\u8fb9\u5982\u4f55\u4f7f\u7528\u4e8c\u8fdb\u5236\u7248\u672c\u5b89\u88c5Percona-5.7.15\u5c31\u4e0d\u8bf4\u4e86\uff0c\u548c\u4e4b\u524d\u4e00\u6a21\u4e00\u6837\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4e0d\u505a\u591a\u4f59\u7684\u4e8b<\/strong><\/div>\n

1\u3001\u89e3\u538b<\/p>\n

2\u3001\u521b\u5efa\u7528\u6237<\/p>\n

3\u3001\u521b\u5efa\u76f8\u5173\u76ee\u5f55\u5e76\u4e14\u8d4b\u4e88MySQL\u6743\u9650<\/p>\n

4\u3001\u4f7f\u7528mysqld\u521d\u59cb\u5316<\/p>\n

\u9ebb\u70e6\u7684\u5730\u65b9<\/strong><\/div>\n

\u6309\u9053\u7406\u6765\u8bf4\u5b89\u88c5\u548c\u542f\u7528MySQL\u5e94\u8be5\u662f\u4e00\u4ef6\u5f88\u5bb9\u6613\u7684\u4e8b\uff0c\u7279\u522b\u662f\u4f7f\u7528\u4e8c\u8fdb\u5236\u7248\u672c\u5b89\u88c5\u7684\u7279\u522b\u5bb9\u6613\u7684\uff0c\u53ea\u8981\u89e3\u538b\u521d\u59cb\u5316\u5c31\u884c\u4e86\u3002<\/p>\n

\u4f46\u662f\u5728Percona-5.7.15(\u5305\u62ec)\u4e4b\u540e\u7684\u7248\u672c\u5b98\u7f51\u4e3a\u4e86\u4e00\u4e2a\u4e25\u91cd\u7684MySQL\u6f0f\u6d1e\uff0c\u4ece\u800c\u5728\u542f\u52a8MySQL\u7684\u65f6\u5019\u4e00\u4e9b\u52a8\u6001\u94fe\u63a5\u5e93\u53ea\u80fd\u4ece\/usr\/lib\u3001\/usr\/lib64\u52a0\u8f7d\u3002\u800c\u4e00\u822c\u6211\u5b89\u88c5MySQL\u90fd\u559c\u6b22\u4f7f\u7528jemalloc\u8fd9\u4e2a\u5185\u5b58\u5206\u914d\uff0c\u800c\u4e0d\u4f7f\u7528linux\u81ea\u5e26\u7684\u548ctcmalloc\u3002\u6240\u4ee5\u5728my.cnf\u914d\u7f6e\u6587\u4ef6\u4e2d\u6709\u5982\u4e0b\u4e00\u4e2a\u914d\u7f6e<\/p>\n

[mysqld_safe]\r\nmalloc-lib          = \/usr\/local\/mysql\/lib\/mysql\/libjemalloc.so.1<\/pre>\n

\u6709\u8bfb\u8fc7mysqld_safe\u542f\u52a8\u7a0b\u5e8f\u6e90\u7801\u7684\u90fd\u77e5\u9053\u5728MySQL\u5728\u5bfb\u627e jemalloc.so.1 \u8fd9\u4e24\u4e2a\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u65f6\u5019\u662f\u5148\u5bfb\u627e\u5230 my.cnf \u4e2d\u8bbe\u7f6e\u7684 basedir<\/p>\n

\u6e90\u7801\u5982\u4e0b:<\/p>\n

#\r\n# Add jemalloc to ld_preload if no other malloc forced - needed for TokuDB\r\n#\r\nif test $load_jemalloc -eq 1\r\nthen\r\n  for libjemall in \"${MY_BASEDIR_VERSION}\/lib\/mysql\" \"\/usr\/lib64\" \"\/usr\/lib\/x86_64-linux-gnu\" \"\/usr\/lib\"; do\r\n    if [ -r \"$libjemall\/libjemalloc.so.1\" ]; then\r\n      add_mysqld_ld_preload \"$libjemall\/libjemalloc.so.1\"\r\n      break\r\n    fi  \r\n  done\r\nfi<\/pre>\n
\u542f\u52a8\u62a5\u9519<\/strong><\/div>\n

\u7531\u4e8elibjemalloc.so.1 \u5728 basedir \u4e2d\u5b58\u5728\uff0c\u53ef\u662fMySQL\u53c8\u9650\u5236\u4e86\u53ea\u80fd\u5728\/usr\/lib64\u3001\/usr\/lib\u7b49\u7b49\u6807\u51c6\u5e93\u4e2d\u52a0\u8f7d\u8fd9\u4e9b\u52a8\u6001\u6587\u4ef6\u6240\u4ee5\u542f\u52a8\u7684\u65f6\u5019\u4f1a\u62a5\u9519\u3002<\/p>\n

\u62a5\u9519\u5982\u4e0b:<\/p>\n

mysqld_safe --malloc-lib must be located in one of the directories: \/usr\/lib \/usr\/lib64 \/usr\/lib\/i386-linux-gnu \/usr\/lib\/x86_64-linux-gnu<\/pre>\n

\u5176\u5b9e\u67e5\u770b\u62a5\u9519\u7684\u63d0\u793a\u5c31\u5f88\u660e\u663e\uff0c\u5c31\u662f\u5bf9\u4e8e\u52a0\u8f7d\u8fd9\u4e9b\u5e93\u53ea\u80fd\u5728\/usr\/lib \/usr\/lib64 \/usr\/lib\/i386-linux-gnu \/usr\/lib\/x86_64-linux-gnu\u8fd9\u4e2a\u5e93\u4e2d<\/p>\n

\u89e3\u51b3<\/strong><\/div>\n
1\u3001\u5c06libjemalloc.so.1\u6587\u4ef6\u62f7\u8d1d\u5230\/usr\/lib \/usr\/lib64 \/usr\/lib\/i386-linux-gnu \/usr\/lib\/x86_64-linux-gnu \u8fd9\u51e0\u4e2a\u76ee\u5f55\u4e2d<\/strong><\/span><\/div>\n
cp \/usr\/local\/mysql\/lib\/mysql\/libjemalloc.so.1 \/usr\/lib64\/libjemalloc.so.1<\/pre>\n
2\u3001\u4fee\u6539[mysqld_safe]<\/strong><\/span><\/div>\n

\u4fee\u6539\u524d:<\/p>\n

[mysqld_safe]\r\nmalloc-lib          = \/usr\/local\/mysql\/lib\/mysql\/libjemalloc.so.1<\/pre>\n

\u4fee\u6539\u540e:<\/p>\n

[mysqld_safe]\r\nmalloc-lib          = \/usr\/lib64\/libjemalloc.so.1<\/pre>\n
3\u3001\u91cd\u542fMySQL<\/strong><\/span><\/div>\n
[root@centos7 mysql]# numactl --interleave=all \/bin\/bash \/usr\/local\/mysql\/bin\/mysqld_safe --defaults-file=\/etc\/my_3306.cnf  \r\n mysqld_safe Adding '\/usr\/lib64\/libjemalloc.so.1' to LD_PRELOAD for mysqld\r\n mysqld_safe Adding '\/usr\/local\/mysql\/lib\/libHotBackup.so' to LD_PRELOAD for mysqld\r\n2016-12-28T09:03:30.653874Z mysqld_safe Logging to '\/u01\/mysql\/mysql_3306\/logs\/trace\/mysql.err'.\r\n2016-12-28T09:03:30.675215Z mysqld_safe Transparent huge pages are already set to: never.\r\n2016-12-28T09:03:30.692654Z mysqld_safe Starting mysqld daemon with databases from \/u01\/mysql\/mysql_3306\/data<\/pre>\n

\u53ef\u89c1\u5df2\u7ecf\u542f\u52a8\u6210\u529f\u4e86<\/p>\n

\u5f53\u7136\u53ef\u4ee5\u53bb\u4fee\u6539mysqld_safe\u6587\u4ef6\u4ee3\u7801\uff0c\u4f46\u662f\u5bf9\u4e8e\u8981\u811a\u672c\u90e8\u7f72\u5c31\u6bd4\u8f83\u9ebb\u70e6\u4e86\uff0c\u9700\u8981\u4f7f\u7528sed\u5bf9\u4ee3\u7801\u8fdb\u884c\u66ff\u6362\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u7248\u672cMySQL\u7684mysqld_safe\u90fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u6240\u4ee5\u8fd9\u8fb9\u5c31\u4f7f\u7528\u62f7\u8d1d\u7684\u65b9\u6cd5\u6682\u65f6\u89e3\u51b3\u3002<\/p>\n

\u6ce8\u610f<\/strong><\/div>\n

MySQL \u7684basedir\u662f\u4e00\u4e2a\u8f6f\u8fde\u63a5\uff0c\u90a3libHotBackup.so\u4e5f\u9700\u8981\u4fee\u6539<\/p>\n

\u5177\u4f53\u6700\u7ec8\u64cd\u4f5c\u5982\u4e0b:<\/p>\n

1\u3001\u62f7\u8d1d\u76f8\u5173\u52a8\u6001\u94fe\u63a5\u5e93<\/strong><\/span><\/div>\n
cp \/usr\/local\/mysql\/lib\/mysql\/libjemalloc.so.1 \/usr\/lib64\/libjemalloc.so.1\r\ncp \/usr\/local\/mysql\/lib\/libHotBackup.so \/usr\/lib64\/libHotBackup.so\r\nmv \/usr\/local\/mysql\/lib\/libHotBackup.so \/usr\/local\/mysql\/lib\/libHotBackup.so.bak<\/pre>\n
2\u3001\u4fee\u6539my.cnf<\/strong><\/span><\/div>\n
[mysqld_safe]\r\nmalloc-lib          = \/usr\/lib64\/libjemalloc.so.1<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.ttlsa.com\/mysql\/percona-5-7-15-binary-version-install-and-start\/<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/percona-binary-install.html<\/a>\u7f16\u8f91\uff1a\u6768\u9e4f\u98de\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u672c\u6587\u5c06\u53d9\u8ff0\u901a\u8fc7\u4e8c\u8fdb\u5236\u6e90\u7801\u65b9\u5f0f\u5b89\u88c5Percona-5.7.15\uff0c\u5e76\u8fdb\u884c\u5feb\u901f\u542f\u52a8\u3002\u8fd9\u8fb9\u5982\u4f55\u4f7f\u7528\u4e8c\u8fdb\u5236\u7248\u672c\u5b89\u88c5 […]<\/p>\n","protected":false},"author":63,"featured_media":45574,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-47262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/47262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=47262"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/47262\/revisions"}],"predecessor-version":[{"id":271266,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/47262\/revisions\/271266"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/45574"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=47262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=47262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=47262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}