{"id":465,"date":"2007-12-26T00:00:00","date_gmt":"2007-12-25T16:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=465"},"modified":"2011-07-15T09:46:25","modified_gmt":"2011-07-15T01:46:25","slug":"mysql-cluster%e9%9b%86%e7%be%a4%e7%a0%94%e7%a9%b6","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=465","title":{"rendered":"MySQL-Cluster\u96c6\u7fa4\u7814\u7a76"},"content":{"rendered":"<p><DIV><br \/>\n<H2>MySQL-Cluster\u96c6\u7fa4\u7814\u7a76<\/H2><br \/>\n<DIV class=t_msgfont>from: discuz wiki<BR><BR><FONT color=black><STRONG>\u4e00\u3001\u4ecb\u7ecd<\/STRONG><\/FONT><BR><BR><FONT color=black>\u8fd9\u7bc7\u6587\u6863\u65e8\u5728\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u914d\u7f6e\u57fa\u4e8e2\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\u3002\u5e76\u4e14\u5b9e\u73b0\u4efb\u610f\u4e00\u53f0\u670d\u52a1\u5668\u51fa\u73b0\u95ee\u9898\u6216\u5b95\u673a\u65f6MySQL\u4f9d\u7136\u80fd\u591f\u7ee7\u7eed\u8fd0\u884c\u3002 <BR><BR>\u6ce8\u610f\uff01 <BR>\u867d\u7136\u8fd9\u662f\u57fa\u4e8e2\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\uff0c\u4f46\u4e5f\u5fc5\u987b\u6709\u989d\u5916\u7684\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\uff0c\u4f46\u8fd9\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u5728\u96c6\u7fa4\u542f\u52a8\u5b8c\u6210\u540e\u5173\u95ed\u3002\u540c\u65f6\u9700\u8981\u6ce8\u610f\u7684\u662f\u5e76\u4e0d\u63a8\u8350\u5728\u96c6\u7fa4\u542f\u52a8\u5b8c\u6210\u540e\u5173\u95ed\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u7684\u670d\u52a1\u5668\u3002\u5c3d\u7ba1\u7406\u8bba\u4e0a\u53ef\u4ee5\u5efa\u7acb\u57fa\u4e8e\u53ea\u67092\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u67b6\u6784\uff0c\u4e00\u65e6\u4e00\u53f0\u670d\u52a1\u5668\u5b95\u673a\u4e4b\u540e\u96c6\u7fa4\u5c31\u65e0\u6cd5\u7ee7\u7eed\u6b63\u5e38\u5de5\u4f5c\u4e86\uff0c\u8fd9\u6837\u4e5f\u5c31\u5931\u53bb\u4e86\u96c6\u7fa4\u7684\u610f\u4e49\u4e86\u3002\u51fa\u4e8e\u8fd9\u4e2a\u539f\u56e0\uff0c\u5c31\u9700\u8981\u6709\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u8fd0\u884c\u3002 <BR><BR>\u53e6\u5916\uff0c\u53ef\u80fd\u5f88\u591a\u670b\u53cb\u90fd\u6ca1\u67093\u53f0\u670d\u52a1\u5668\u7684\u5b9e\u9645\u73af\u5883\uff0c\u53ef\u4ee5\u8003\u8651\u5728VMWare\u6216\u5176\u4ed6\u865a\u62df\u673a\u4e2d\u8fdb\u884c\u5b9e\u9a8c\u3002 <BR><BR>\u4e0b\u9762\u5047\u8bbe\u8fd93\u53f0\u670d\u52a1\u7684\u60c5\u51b5\uff1a <\/FONT><BR><BR><\/DIV><FONT color=black><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2>Server1: mysql1.vmtest.net 192.168.0.1<BR>Server2: mysql2.vmtest.net 192.168.0.2<BR>Server3: mysql3.vmtest.net 192.168.0.3<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR>Servers1\u548cServer2\u4f5c\u4e3a\u5b9e\u9645\u914d\u7f6eMySQL\u96c6\u7fa4\u7684\u670d\u52a1\u5668\u3002\u5bf9\u4e8e\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u7684Server3\u5219\u8981\u6c42\u8f83\u4f4e\uff0c\u53ea\u9700\u5bf9Server3\u7684\u7cfb\u7edf\u8fdb\u884c\u5f88\u5c0f\u7684\u8c03\u6574\u5e76\u4e14\u65e0\u9700\u5b89\u88c5MySQL\uff0cServer3\u53ef\u4ee5\u4f7f\u7528\u4e00\u53f0\u914d\u7f6e\u8f83\u4f4e\u7684\u8ba1\u7b97\u673a\u5e76\u4e14\u53ef\u4ee5\u5728Server3\u540c\u65f6\u8fd0\u884c\u5176\u4ed6\u670d\u52a1\u3002<BR><BR><BR><STRONG>\u4e8c\u3001\u5728Server1\u548cServer2\u4e0a\u5b89\u88c5MySQL<\/STRONG><BR><BR>\u4ece<A href=\"http:\/\/www.mysql.com\u4e0a\u4e0b\u8f7dmysql-max-4.1.9-pc-linux-gnu-i686.tar.gz\/\" target=_blank><FONT color=#0000ff>http:\/\/www.mysql.com\u4e0a\u4e0b\u8f7dmysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<\/FONT><\/A> <BR><BR>\u6ce8\u610f\uff1a\u5fc5\u987b\u662fmax\u7248\u672c\u7684MySQL\uff0cStandard\u7248\u672c\u4e0d\u652f\u6301\u96c6\u7fa4\u90e8\u7f72\uff01 <BR><BR>\u4ee5\u4e0b\u6b65\u9aa4\u9700\u8981\u5728Server1\u548cServer2\u4e0a\u5404\u505a\u4e00\u6b21 <BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># mv mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz \/usr\/local\/<BR># cd \/usr\/local\/<BR># groupadd mysql<BR># useradd -g mysql mysql<BR># tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<BR># rm -f mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<BR># mv mysql-max-4.1.9-pc-linux-gnu-i686 mysql<BR># cd mysql<BR># scripts\/mysql_install_db &#8211;user=mysql<BR># chown -R root&nbsp;&nbsp;.<BR># chown -R mysql data<BR># chgrp -R mysql .<BR># cp support-files\/mysql.server \/etc\/rc.d\/init.d\/mysqld<BR># chmod +x \/etc\/rc.d\/init.d\/mysqld<BR># chkconfig &#8211;add mysqld<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR>\u6b64\u65f6\u4e0d\u8981\u542f\u52a8MySQL\uff01 <BR><BR><BR><STRONG>\u4e09\u3001\u5b89\u88c5\u5e76\u914d\u7f6e\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668(Server3)<\/STRONG><BR><BR>\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668\uff0cServer3\u9700\u8981ndb_mgm\u548cndb_mgmd\u4e24\u4e2a\u6587\u4ef6\uff1a<BR><BR>\u4ece<A href=\"http:\/\/www.mysql.com\u4e0a\u4e0b\u8f7dmysql-max-4.1.9-pc-linux-gnu-i686.tar.gz\/\" target=_blank><FONT color=#0000ff>http:\/\/www.mysql.com\u4e0a\u4e0b\u8f7dmysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<\/FONT><\/A> <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># mkdir \/usr\/src\/mysql-mgm<BR># cd \/usr\/src\/mysql-mgm<BR># tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<BR># rm mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz<BR># cd mysql-max-4.1.9-pc-linux-gnu-i686<BR># mv bin\/ndb_mgm .<BR># mv bin\/ndb_mgmd .<BR># chmod +x ndb_mg*<BR># mv ndb_mg* \/usr\/bin\/<BR># cd<BR># rm -rf \/usr\/src\/mysql-mgm<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR>\u73b0\u5728\u5f00\u59cb\u4e3a\u8fd9\u53f0\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668\u5efa\u7acb\u914d\u7f6e\u6587\u4ef6\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># mkdir \/var\/lib\/mysql-cluster<BR># cd \/var\/lib\/mysql-cluster<BR># vi config.ini<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u5728config.ini\u4e2d\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 98%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2>[NDBD DEFAULT]<BR>NoOfReplicas=2<BR>[MYSQLD DEFAULT]<BR>[NDB_MGMD DEFAULT]<BR>[TCP DEFAULT]<BR># Managment Server<BR>[NDB_MGMD]<BR>HostName=192.168.0.3 #\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668Server3\u7684IP\u5730\u5740<BR># Storage Engines<BR>[NDBD]<BR>HostName=192.168.0.1 #MySQL\u96c6\u7fa4Server1\u7684IP\u5730\u5740<BR>DataDir= \/var\/lib\/mysql-cluster<BR>[NDBD]<BR>HostName=192.168.0.2 #MySQL\u96c6\u7fa4Server2\u7684IP\u5730\u5740<BR>DataDir=\/var\/lib\/mysql-cluster<BR># \u4ee5\u4e0b2\u4e2a[MYSQLD]\u53ef\u4ee5\u586b\u5199Server1\u548cServer2\u7684\u4e3b\u673a\u540d\u3002<BR># \u4f46\u4e3a\u4e86\u80fd\u591f\u66f4\u5feb\u7684\u66f4\u6362\u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u5668\uff0c\u63a8\u8350\u7559\u7a7a\uff0c\u5426\u5219\u66f4\u6362\u670d\u52a1\u5668\u540e\u5fc5\u987b\u5bf9\u8fd9\u4e2a\u914d\u7f6e\u8fdb\u884c\u66f4\u6539\u3002<BR>[MYSQLD]<BR>[MYSQLD]<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u4fdd\u5b58\u9000\u51fa\u540e\uff0c\u542f\u52a8\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668Server3\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># ndb_mgmd<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR>\u542f\u52a8\u7ba1\u7406\u8282\u70b9\u540e\u5e94\u8be5\u6ce8\u610f\uff0c\u8fd9\u53ea\u662f\u7ba1\u7406\u8282\u70b9\u670d\u52a1\uff0c\u5e76\u4e0d\u662f\u7ba1\u7406\u7ec8\u7aef\u3002\u56e0\u800c\u4f60\u770b\u4e0d\u5230\u4efb\u4f55\u5173\u4e8e\u542f\u52a8\u540e\u7684\u8f93\u51fa\u4fe1\u606f\u3002 <BR><BR><BR><STRONG>\u56db\u3001\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u5e76\u542f\u52a8MySQL<\/STRONG><BR><BR>\u5728Server1\u548cServer2\u4e2d\u90fd\u9700\u8981\u8fdb\u884c\u5982\u4e0b\u6539\u52a8\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># vi \/etc\/my.cnf<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2>[mysqld]<BR>ndbcluster<BR>ndb-connectstring=192.168.0.3 #Server3\u7684IP\u5730\u5740<BR>[mysql_cluster]<BR>ndb-connectstring=192.168.0.3 #Server3\u7684IP\u5730\u5740<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u4fdd\u5b58\u9000\u51fa\u540e\uff0c\u5efa\u7acb\u6570\u636e\u76ee\u5f55\u5e76\u542f\u52a8MySQL\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># mkdir \/var\/lib\/mysql-cluster<BR># cd \/var\/lib\/mysql-cluster<BR># \/usr\/local\/mysql\/bin\/ndbd &#8211;initial<BR># \/etc\/rc.d\/init.d\/mysqld start<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u53ef\u4ee5\u628a\/usr\/local\/mysql\/bin\/ndbd\u52a0\u5230\/etc\/rc.local\u4e2d\u5b9e\u73b0\u5f00\u673a\u542f\u52a8\u3002 <BR><BR>\u6ce8\u610f\uff1a\u53ea\u6709\u5728\u7b2c\u4e00\u6b21\u542f\u52a8ndbd\u65f6\u6216\u8005\u5bf9Server3\u7684config.ini\u8fdb\u884c\u6539\u52a8\u540e\u624d\u9700\u8981\u4f7f\u7528&#8211;initial\u53c2\u6570\uff01 <BR><BR><BR><STRONG>\u4e94\u3001\u68c0\u67e5\u5de5\u4f5c\u72b6\u6001<\/STRONG><BR><BR>\u56de\u5230\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668Server3\u4e0a\uff0c\u5e76\u542f\u52a8\u7ba1\u7406\u7ec8\u7aef\uff1a<BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># \/usr\/bin\/ndb_mgm<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u952e\u5165show\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u5de5\u4f5c\u72b6\u6001\uff1a\uff08\u4e0b\u9762\u662f\u4e00\u4e2a\u72b6\u6001\u8f93\u51fa\u793a\u4f8b\uff09 <BR><BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 419px\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2>[root@mysql3 root]# \/usr\/bin\/ndb_mgm<BR>&#8212; NDB Cluster &#8212; Management Client &#8212;<BR>ndb_mgm&gt; show<BR>Connected to Management Server at: localhost:1186<BR>Cluster Configuration<BR>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<BR>[ndbd(NDB)]&nbsp; &nbsp;&nbsp;&nbsp;2 node(s)<BR>id=2&nbsp; &nbsp; @192.168.0.1&nbsp;&nbsp;(Version: 4.1.9, Nodegroup: 0, Master)<BR>id=3&nbsp; &nbsp; @192.168.0.2&nbsp;&nbsp;(Version: 4.1.9, Nodegroup: 0)<BR>[ndb_mgmd(MGM)] 1 node(s)<BR>id=1&nbsp; &nbsp; @192.168.0.3&nbsp;&nbsp;(Version: 4.1.9)<BR>[mysqld(API)]&nbsp; &nbsp;2 node(s)<BR>id=4&nbsp; &nbsp;(Version: 4.1.9)<BR>id=5&nbsp; &nbsp;(Version: 4.1.9)<BR>ndb_mgm&gt;<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u5982\u679c\u4e0a\u9762\u6ca1\u6709\u95ee\u9898\uff0c\u73b0\u5728\u5f00\u59cb\u6d4b\u8bd5MySQL\uff1a <BR><BR>\u6ce8\u610f\uff0c\u8fd9\u7bc7\u6587\u6863\u5bf9\u4e8eMySQL\u5e76\u6ca1\u6709\u8bbe\u7f6eroot\u5bc6\u7801\uff0c\u63a8\u8350\u4f60\u81ea\u5df1\u8bbe\u7f6eServer1\u548cServer2\u7684MySQL root\u5bc6\u7801\u3002 <BR><BR>\u5728Server1\u4e2d\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># \/usr\/local\/mysql\/bin\/mysql -u root -p<BR>&gt; use test;<BR>&gt; CREATE TABLE ctest (i INT) ENGINE=NDBCLUSTER;<BR>&gt; INSERT INTO ctest () VALUES (1);<BR>&gt; SELECT * FROM ctest;<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u5e94\u8be5\u53ef\u4ee5\u770b\u52301 row returned\u4fe1\u606f\uff08\u8fd4\u56de\u6570\u503c1\uff09\u3002 <BR><BR>\u5982\u679c\u4e0a\u8ff0\u6b63\u5e38\uff0c\u5219\u6362\u5230Server2\u4e0a\u91cd\u590d\u4e0a\u9762\u7684\u6d4b\u8bd5\uff0c\u89c2\u5bdf\u6548\u679c\u3002\u5982\u679c\u6210\u529f\uff0c\u5219\u5728Server2\u4e2d\u6267\u884cINSERT\u518d\u6362\u56de\u5230Server1\u89c2\u5bdf\u662f\u5426\u5de5\u4f5c\u6b63\u5e38\u3002 <BR><BR>\u5982\u679c\u90fd\u6ca1\u6709\u95ee\u9898\uff0c\u90a3\u4e48\u606d\u559c\u6210\u529f\uff01 <BR><BR><BR><STRONG>\u516d\u3001\u7834\u574f\u6027\u6d4b\u8bd5<\/STRONG><BR><BR>\u5c06Server1\u6216Server2\u7684\u7f51\u7ebf\u62d4\u6389\uff0c\u89c2\u5bdf\u53e6\u5916\u4e00\u53f0\u96c6\u7fa4\u670d\u52a1\u5668\u5de5\u4f5c\u662f\u5426\u6b63\u5e38\uff08\u53ef\u4ee5\u4f7f\u7528SELECT\u67e5\u8be2\u6d4b\u8bd5\uff09\u3002\u6d4b\u8bd5\u5b8c\u6bd5\u540e\uff0c\u91cd\u65b0\u63d2\u5165\u7f51\u7ebf\u5373\u53ef\u3002 <BR><BR>\u5982\u679c\u4f60\u63a5\u89e6\u4e0d\u5230\u7269\u7406\u670d\u52a1\u5668\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e0d\u80fd\u62d4\u6389\u7f51\u7ebf\uff0c\u90a3\u4e5f\u53ef\u4ee5\u8fd9\u6837\u6d4b\u8bd5\uff1a\u5728Server1\u6216Server2\u4e0a\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># ps aux | grep ndbd<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u5c06\u4f1a\u770b\u5230\u6240\u6709ndbd\u8fdb\u7a0b\u4fe1\u606f\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 98%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2>root&nbsp; &nbsp;&nbsp; &nbsp;5578&nbsp;&nbsp;0.0&nbsp;&nbsp;0.3&nbsp;&nbsp;6220 1964 ?&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;S&nbsp; &nbsp; 03:14&nbsp; &nbsp;0:00 ndbd<BR>root&nbsp; &nbsp;&nbsp; &nbsp;5579&nbsp;&nbsp;0.0 20.4 492072 102828 ?&nbsp; &nbsp;&nbsp;&nbsp;R&nbsp; &nbsp; 03:14&nbsp; &nbsp;0:04 ndbd<BR>root&nbsp; &nbsp;&nbsp;&nbsp;23532&nbsp;&nbsp;0.0&nbsp;&nbsp;0.1&nbsp;&nbsp;3680&nbsp;&nbsp;684 pts\/1&nbsp; &nbsp; S&nbsp; &nbsp; 07:59&nbsp; &nbsp;0:00 grep ndbd<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u7136\u540e\u6740\u6389\u4e00\u4e2andbd\u8fdb\u7a0b\u4ee5\u8fbe\u5230\u7834\u574fMySQL\u96c6\u7fa4\u670d\u52a1\u5668\u7684\u76ee\u7684\uff1a <BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2><\/FONT><FONT size=2># kill -9 5578 5579<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u4e4b\u540e\u5728\u53e6\u4e00\u53f0\u96c6\u7fa4\u670d\u52a1\u5668\u4e0a\u4f7f\u7528SELECT\u67e5\u8be2\u6d4b\u8bd5\u3002\u5e76\u4e14\u5728\u7ba1\u7406\u8282\u70b9\u670d\u52a1\u5668\u7684\u7ba1\u7406\u7ec8\u7aef\u4e2d\u6267\u884cshow\u547d\u4ee4\u4f1a\u770b\u5230\u88ab\u7834\u574f\u7684\u90a3\u53f0\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002 <BR><BR>\u6d4b\u8bd5\u5b8c\u6210\u540e\uff0c\u53ea\u9700\u8981\u91cd\u65b0\u542f\u52a8\u88ab\u7834\u574f\u670d\u52a1\u5668\u7684ndbd\u8fdb\u7a0b\u5373\u53ef\uff1a <BR><BR><BR><\/DIV><br \/>\n<DIV class=t_msgfont><br \/>\n<TABLE class=t_table style=\"WIDTH: 50%\" cellSpacing=0 bgColor=silver><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><FONT size=2># ndbd<\/FONT><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV class=t_msgfont><BR><BR>\u6ce8\u610f\uff01\u524d\u9762\u8bf4\u8fc7\u4e86\uff0c\u6b64\u65f6\u662f\u4e0d\u7528\u52a0&#8211;inital\u53c2\u6570\u7684\uff01 <BR><BR><BR><BR>\u81f3\u6b64\uff0cMySQL\u96c6\u7fa4\u5c31\u914d\u7f6e\u5b8c\u6210\u4e86\uff01 <\/DIV><br \/>\n<DIV class=t_msgfont>&nbsp;<\/DIV><br \/>\n<DIV class=t_msgfont>\u6587\u7ae0\u6765\u6e90:http:\/\/www.mysqlpub.com\/viewthread.php?tid=194&amp;extra=page%3D1<\/FONT><\/DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL-Cluster\u96c6\u7fa4\u7814\u7a76 from: discuz wiki\u4e00\u3001\u4ecb\u7ecd\u8fd9\u7bc7\u6587\u6863\u65e8\u5728\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u914d\u7f6e\u57fa\u4e8e2\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\u3002\u5e76\u4e14\u5b9e\u73b0\u4efb\u610f\u4e00\u53f0\u670d\u52a1\u5668\u51fa\u73b0\u95ee\u9898\u6216\u5b95\u673a\u65f6MySQL\u4f9d\u7136\u80fd\u591f\u7ee7\u7eed\u8fd0\u884c\u3002 \u6ce8\u610f\uff01 \u867d\u7136\u8fd9\u662f\u57fa\u4e8e2\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\uff0c\u4f46\u4e5f\u5fc5\u987b\u6709\u989d\u5916\u7684\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\uff0c\u4f46\u8fd9\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u5728\u96c6\u7fa4\u542f\u52a8\u5b8c\u6210\u540e\u5173\u95ed\u3002\u540c\u65f6\u9700\u8981\u6ce8\u610f\u7684\u662f\u5e76\u4e0d\u63a8\u8350\u5728\u96c6\u7fa4\u542f\u52a8\u5b8c\u6210\u540e\u5173\u95ed\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u7684\u670d\u52a1\u5668\u3002\u5c3d\u7ba1\u7406\u8bba\u4e0a\u53ef\u4ee5\u5efa\u7acb\u57fa\u4e8e\u53ea\u67092\u53f0\u670d\u52a1\u5668\u7684MySQL\u96c6\u7fa4\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u67b6\u6784\uff0c\u4e00\u65e6\u4e00\u53f0\u670d\u52a1\u5668\u5b95\u673a\u4e4b\u540e\u96c6\u7fa4\u5c31\u65e0\u6cd5\u7ee7\u7eed\u6b63\u5e38\u5de5\u4f5c\u4e86\uff0c\u8fd9\u6837\u4e5f\u5c31\u5931\u53bb\u4e86\u96c6\u7fa4\u7684\u610f\u4e49\u4e86\u3002\u51fa\u4e8e\u8fd9\u4e2a\u539f\u56e0\uff0c\u5c31\u9700\u8981\u6709\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u8fd0\u884c\u3002 \u53e6\u5916\uff0c\u53ef\u80fd\u5f88\u591a\u670b\u53cb\u90fd\u6ca1\u67093\u53f0\u670d\u52a1\u5668\u7684\u5b9e\u9645\u73af\u5883\uff0c\u53ef\u4ee5\u8003\u8651\u5728VMWare\u6216\u5176\u4ed6\u865a\u62df\u673a\u4e2d\u8fdb\u884c\u5b9e\u9a8c\u3002 \u4e0b\u9762\u5047\u8bbe\u8fd93\u53f0\u670d\u52a1\u7684\u60c5\u51b5\uff1a Server1: mysql1.vmtest.net 192.168.0.1Server2: mysql2.vmtest.net 192.168.0.2Server3: mysql3.vmtest.net 192.168.0.3 Servers1\u548cServer2\u4f5c\u4e3a\u5b9e\u9645\u914d\u7f6eMySQL\u96c6\u7fa4\u7684\u670d\u52a1\u5668\u3002\u5bf9\u4e8e\u4f5c\u4e3a\u7ba1\u7406\u8282\u70b9\u7684Server3\u5219\u8981\u6c42\u8f83\u4f4e\uff0c\u53ea\u9700\u5bf9Server3\u7684\u7cfb\u7edf\u8fdb\u884c\u5f88\u5c0f\u7684\u8c03\u6574\u5e76\u4e14\u65e0\u9700\u5b89\u88c5MySQL\uff0cServer3\u53ef\u4ee5\u4f7f\u7528\u4e00\u53f0\u914d\u7f6e\u8f83\u4f4e\u7684\u8ba1\u7b97\u673a\u5e76\u4e14\u53ef\u4ee5\u5728Server3\u540c\u65f6\u8fd0\u884c\u5176\u4ed6\u670d\u52a1\u3002\u4e8c\u3001\u5728Server1\u548cServer2\u4e0a\u5b89\u88c5MySQL\u4ecehttp:\/\/www.mysql.com\u4e0a\u4e0b\u8f7dmysql-max-4.1.9-pc-linux-gnu-i686.tar.gz \u6ce8\u610f\uff1a\u5fc5\u987b\u662fmax\u7248\u672c\u7684MySQL\uff0cStandard\u7248\u672c\u4e0d\u652f\u6301\u96c6\u7fa4\u90e8\u7f72\uff01 \u4ee5\u4e0b\u6b65\u9aa4\u9700\u8981\u5728Server1\u548cServer2\u4e0a\u5404\u505a\u4e00\u6b21 # mv mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz \/usr\/local\/# cd \/usr\/local\/# groupadd mysql# useradd -g mysql mysql# tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz# rm -f mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz# mv mysql-max-4.1.9-pc-linux-gnu-i686 mysql# cd mysql# scripts\/mysql_install_db &#8211;user=mysql# chown -R root&nbsp;&nbsp;.# chown -R mysql data# chgrp -R mysql .# cp &hellip; <a href=\"https:\/\/www.strongd.net\/?p=465\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">MySQL-Cluster\u96c6\u7fa4\u7814\u7a76<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[119],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-mysql-cluster"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=465"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions"}],"predecessor-version":[{"id":905,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions\/905"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}