{"id":4715,"date":"2021-09-26T12:02:35","date_gmt":"2021-09-26T04:02:35","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=4715"},"modified":"2021-10-27T14:40:18","modified_gmt":"2021-10-27T06:40:18","slug":"tdh%e9%9b%86%e7%be%a4%e5%8d%87%e7%ba%a7mariadb%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=4715","title":{"rendered":"TDH\u96c6\u7fa4\u5347\u7ea7MariaDB\u65b9\u6cd5"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>\u5bf9 TDH \u96c6\u7fa4\u8fdb\u884c\u5b89\u5168\u626b\u63cf\uff0c\u6709\u53ef\u80fd\u4f1a\u626b\u63cf\u51fa MariaDB \u7684\u6f0f\u6d1e\uff0c\u8fd9\u662f\u56e0\u4e3a Manager \u7ec4\u4ef6\u4eceTDH 5.0 \u5f00\u59cb\u4f7f\u7528\u4e86 MariaDB \u975e\u6700\u65b0\u7684\u7248\u672c\u5b58\u50a8\u5143\u6570\u636e\u3002<\/p>\n<p>\u53ef\u4ee5\u53c2\u7167\u672c\u6587\u65b9\u6cd5\u5bf9MariaDB\u6570\u636e\u5e93\u8fdb\u884c\u5347\u7ea7\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<p>\u672c\u6587\u4ecb\u7ecd\u7684\u5347\u7ea7\u65b9\u6848\u9002\u7528\u73af\u5883\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aCentOS 7.x<\/li>\n<li>TDH\u96c6\u7fa4\uff1aTDH 5.X~7.X<\/li>\n<\/ul>\n<p><strong>\u53ef\u4ee5\u53c2\u7167\u5982\u4e0b\u65b9\u6cd5\u5c06MariaDB\u5347\u7ea7\u523010.2.7, MariaDB 10.2.7\u662f\u672c\u6587\u53d1\u5e03\u7684\u65f6\u5019\u5df2\u7ecf\u7ecf\u8fc7\u9a8c\u8bc1\u7684\u4e0e TDH \u96c6\u7fa4\u9002\u914d\u7684\u6700\u9ad8\u7248\u672c\uff0c\u4f7f\u7528\u672c\u6587\u6863\u6765\u5347\u7ea7\u5230\u66f4\u9ad8\u7248\u672c\u4e0d\u80fd\u4fdd\u8bc1\u6b63\u786e\u6027\u3002<\/strong><\/p>\n<ol>\n<li>\n<p><a href=\"http:\/\/crm.transwarp.io\/resources\/download\/3790\" title=\"\u70b9\u51fb\u4e0b\u8f7d\">\u70b9\u51fb\u4e0b\u8f7d<\/a> MariaDB 10.2.7 \u66f4\u65b0\u5305: <strong><code>MariaDB_10.2.7.tar<\/code><\/strong><br \/>\n(MD5: 8c2a0dec7d3d5684023f169ff63ef2fd)<\/p>\n<\/li>\n<li>\n<p>\u5c06\u5176\u4e0a\u4f20\u5230\u9700\u8981\u5347\u7ea7 MariaDB \u7684TDH Manager\u8282\u70b9\u5e76\u89e3\u538b\uff1a<strong><code>tar -xvf MariaDB_10.2.7.tar<\/code><\/strong>\uff0c\u89e3\u538b\u540e\uff0c\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u88ab\u89e3\u538b\u5230\u4e86 <strong><code>mariadb-10.2.7-rhel-7-x86_64-rpms<\/code><\/strong> \u76ee\u5f55\uff1a<\/p>\n<pre><code># tar -xvf MariaDB_10.2.7.tar<\/code><\/pre>\n<\/li>\n<li>\n<p>\u505c\u6b62\u6b63\u5728\u8fd0\u884c\u7684transwarp-manager-db\u670d\u52a1\uff0c\u5e76\u5907\u4efd\u6570\u636e\u5e93\u3002<br \/>\n\u505c\u6b62\u6570\u636e\u5e93\u670d\u52a1\uff1a<strong>systemctl stop transwarp-manager-db<\/strong><br \/>\n\u5907\u4efd\u6570\u636e\u5e93\uff1a<strong>cp -r \/var\/lib\/transwarp-manager\/master\/data\/mysql\/ \/var\/lib\/transwarp-manager\/master\/data\/mysql.bak\/<\/strong><\/p>\n<pre><code class=\"language-shell\">\/\/\u505c\u6b62\u6570\u636e\u5e93\u670d\u52a1\n# systemctl stop transwarp-manager-db\n\u3000\n\/\/\u5907\u4efd\u6570\u636e\u5e93\n#cp -r \/var\/lib\/transwarp-manager\/master\/data\/mysql\/ \/var\/lib\/transwarp-manager\/master\/data\/mysql.bak\/<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8fdb\u5165 <strong><code>mariadb-10.2.7-rhel-7-x86_64-rpms<\/code><\/strong> \u76ee\u5f55\uff0c\u8fd0\u884c\u811a\u672c <strong><code>setup_repository<\/code><\/strong> \u811a\u672c\u8bbe\u7f6e\u5347\u7ea7\u4f7f\u7528\u7684MaraiaDB Repo\uff1a<\/p>\n<pre><code># cd mariadb-10.2.7-rhel-7-x86_64-rpms\n# .\/setup_repository<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5MariaDB\u5347\u7ea7\uff1a<strong>yum install -y MariaDB-server<\/strong><\/p>\n<pre><code># yum install -y MariaDB-server<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5220\u9664\u7b2c4\u6b65\u521b\u5efa\u7684Repo\u6e90\uff1a<strong>rm -f \/etc\/yum.repos.d\/mariadb.repo<\/strong><\/p>\n<pre><code># rm -f \/etc\/yum.repos.d\/mariadb.repo<\/code><\/pre>\n<\/li>\n<li>\n<p>\u4fee\u6539mysql\u65e5\u5fd7\u6240\u5728\u76ee\u5f55\u6743\u9650\uff1a<strong>chmod a+x \/var\/log\/transwarp-manager\/master<\/strong><\/p>\n<pre><code># chmod a+x \/var\/log\/transwarp-manager\/master<\/code><\/pre>\n<\/li>\n<li>\n<p>\u542f\u52a8transwarp-manager-db\u6570\u636e\u5e93\u670d\u52a1\uff1a<strong>systemctl start transwarp-manager-db<\/strong><\/p>\n<pre><code># systemctl start transwarp-manager-db<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6267\u884c <strong>mysql_upgrade<\/strong> :<\/p>\n<ul>\n<li>TDH 5.x, 6.x, 7.x\uff1a\n<pre><code># mysql_upgrade -uroot -p$(cat \/etc\/transwarp-manager\/master\/db.properties |grep io.transwarp.manager.db.password |awk -F = '{print $2}') -S  \/var\/run\/mariadb\/transwarp-manager-db.sock<\/code><\/pre>\n<\/li>\n<li>TDH 4.x:\n<pre><code># mysql_upgrade<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6b63\u786e\u5b8c\u6210\u5347\u7ea7\u540e\uff0c\u53ef\u91ca\u653e\u5907\u4efd\u7684\u6570\u636e\uff1a<\/p>\n<pre><code># rm -rf \/var\/lib\/transwarp-manager\/master\/data\/mysql.bak\/<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4>\u5347\u7ea7\u5931\u8d25\u7684\u5e38\u89c1\u95ee\u9898<\/h4>\n<ol>\n<li>\n<p>\u8fd0\u884c <strong>yum install MariaDB-server<\/strong> \u5931\u8d25<\/p>\n<ul>\n<li>\u539f\u56e01\uff1a\u5b89\u88c5MariaDB-server\u65f6\uff0c\u9700\u8981\u68c0\u67e5\u76f8\u5173\u4f9d\u8d56\uff0c\u4ece\u7cfb\u7edfrepo\u6e90\u4e2d\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5f53\u524d\u9519\u8bef\u662fos.repo\u6e90\u7684\u914d\u7f6e\u6587\u4ef6\u635f\u574f<\/li>\n<li>\u89e3\u51b3\u65b9\u6cd51\uff1a\u8fdb\u5165\/var\/lib\/transwarp-manager\/master\/pub\/os\/Packages\uff0c\u5229\u7528rpm -ivh\u624b\u52a8\u5b89\u88c5\u62a5\u9519\u7684\u5305<\/li>\n<li>\u539f\u56e02\uff1aMariaDB\u7684Repo\u914d\u7f6e\u6587\u4ef6\/etc\/yum.repos.d\/mariadb.repo\u4e2d\u6709gpgkey\u90a3\u884c\uff0c\u5b89\u88c5\u7684\u65f6\u5019\u4f1a\u6839\u636e\u8be5\u5730\u5740\u53bbcheck\u662f\u5426\u6b63\u786e\uff0c\u5f53\u65e0\u6cd5\u8fde\u63a5\u5916\u7f51\u65f6\uff0c\u62a5\u9519<\/li>\n<li>\u89e3\u51b3\u65b9\u6cd52\uff1a\u4fee\u6539MariaDB Repo\u914d\u7f6e\u6587\u4ef6 \/etc\/yum.repos.d\/mariadb.repo, \u6ce8\u91ca\u6389gpgkey\u884c\uff0c\u7136\u540e\u52a0\u4e0a <strong>gpgcheck=0<\/strong>, \u7136\u540e\u6267\u884c\u4e0b <strong>yum clean all<\/strong>, \u518d\u91cd\u65b0 <strong>yum install MariaDB-server<\/strong> \u5b89\u88c5<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5f53\u96c6\u7fa4\u5f00\u542fManager HA\u540e\uff0cmysql_upgrade\u6267\u884c\u5931\u8d25\uff0c\u5229\u7528\u524d\u9762\u7684mysql_upgrade\u547d\u4ee4\u5347\u7ea7\u62a5\u9519<\/p>\n<ul>\n<li>\u539f\u56e0\uff1a\u5f53\u524d\u76ee\u5f55\u4e0b\u6ca1\u6709transwarp-manager\u6570\u636e\u5e93\u76ee\u5f55\uff0c\u4e0d\u80fd\u901a\u8fc7\u4e4b\u524d\u7684\u547d\u4ee4\u66f4\u65b0manager\u6570\u636e\u5e93<\/li>\n<li>\u89e3\u51b3\u65b9\u6cd5\uff1a\u53bb\u6389-u \u548c-p\u53c2\u6570\uff1a\n<pre><code># mysql_upgrade -S \/var\/run\/mariadb\/transwarp-manager-db.sock<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u82e5\u6709\u5176\u4ed6\u7591\u95ee\uff0c\u60a8\u4e5f\u53ef\u4ee5 <a href=\"\/?p=641\" title=\"\u8054\u7cfb\u661f\u73af\u79d1\u6280\u5168\u7403\u6280\u672f\u652f\u6301\u4e2d\u5fc3\">\u8054\u7cfb\u661f\u73af\u79d1\u6280\u5168\u7403\u6280\u672f\u652f\u6301\u4e2d\u5fc3<\/a> \u4ee5\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 \u5bf9 TDH \u96c6\u7fa4\u8fdb\u884c\u5b89\u5168\u626b\u63cf\uff0c\u6709\u53ef\u80fd\u4f1a\u626b\u63cf\u51fa MariaDB \u7684\u6f0f\u6d1e\uff0c\u8fd9\u662f\u56e0\u4e3a Manager \u7ec4\u4ef6 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=4715\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,33,122],"tags":[],"class_list":["post-4715","post","type-post","status-publish","format-standard","hentry","category-upgrade","category-installation","category-vulnerabilities_info"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4715"}],"version-history":[{"count":4,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4715\/revisions"}],"predecessor-version":[{"id":6977,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4715\/revisions\/6977"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}