mysql 5.0 ¼¯Èº¸ºÔؾùºâ—¾¹ý²âÊÔ
תÔØÇë×¢Ã÷×÷Õߺͳö´¦
http://www.cnlinux.net
Ò»¡¢½éÉÜ
========
²âÊÔ»·¾³£º
Server1:ndbd 192.168.0.11
Server2:ndbd 192.168.0.12
Server3:mysqld --ndb-cluster 192.168.0.13 (ndbd_mgm ndbd_mgmdÒ²ÔÚ±¾»ú)
²Ù×÷ϵͳ¾ùΪ
RH ES3
kernel-2.4.21-9.EL
glibc-2.3.2-95.6
ËùÐèÈí¼þ°ü£º
mysql-max-5.0.22-linux-i686-icc-glibc23.tar.gz
ÏÂÔصØÖ·£ºhttp://dev.mysql.com/downloads/mysql/5.0.html
ÏÂÔØʱעÒâϵͳ»·¾³ºÍÈí¼þ°ü°æ±¾£¬MySQLÊÇmax°æµÄ¡£
Ê×ÏÈ£¬Ã÷È·¼¸¸ö¸ÅÄ²ÎÕÕÏÂͼ£©£º
ndbd£º Êý¾Ý¿â½Úµã¡£
mysqld --ndb-cluster£º MySQL·þÎñÆ÷½Úµã£¬³ÌÐòÖ±½Ó·ÃÎʵÄÊÇÕą̂»úÆ÷µÄIP¡£Ä¬È϶˿ÚÈÔÊÇ3306¡£
ndbd_mgm ndbd_mgmd£º ¹ÜÀí½Úµã¡£¹ÜÀí£¯²é¿´¸÷¿â½ÚµãºÍ·þÎñÆ÷½ÚµãµÄ״̬¡£
¶þ¡¢ÔÚServer1¡¢Server2¡¢Server3ÉÏ°²×°MySQL
=================================
1.°²×°£º
# mv mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz /usr/local/
# cd /usr/local/
# tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
# mv mysql-max-4.1.9-pc-linux-gnu-i686 mysql
# groupadd mysql
# useradd -g mysql mysql
# cd mysql
# scripts/mysql_install_db --user=mysql
# chown -R mysql:mysql .
2.±à¼ÅäÖÃÎļþ£º
# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf ÔÚÎļþβ¼ÓÈë
# my.cnf
# example additions to my.cnf for MySQL Cluster
# (valid in MySQL 5.0)
# enable ndbcluster storage engine, and provide connectstring for
# management Server host (default port is 1186)
[mysqld]
ndbcluster
ndb-connectstring=192.168.0.13
# provide connectstring for management Server host (default port: 1186)
[ndbd]
connect-string=192.168.0.13
# provide connectstring for management Server host (default port: 1186)
[ndb_mgm]
connect-string=192.168.0.13
# provide location of cluster configuration file
[ndb_mgmd]
config-file=/var/lib/mysql-cluster
±£´æ£¦Í˳ö
3.ÔÚServer1¡¢Server2ÉÏ´´½¨ÈÕÖ¾Îļþ¼Ð£¬Ä¬ÈÏ
# mkdir /var/lib/mysql-cluster
4.ÔÚServer3ÉÏ´´½¨ndb_mgmdÆô¶¯ÅäÖÃÎļþ£º
# mkdir /var/lib/mysql-cluster
# cd /var/lib/mysql-cluster
# vi config.ini
ÄÚÈÝÈçÏ£º
# file "config.ini" - 2 data nodes and 2 SQL nodes
# T
Ïà¹ØÎĵµ£º
½ñÌìΪÁË°²×°MySQl£¬¸ãÁË5¸ö¶àÖÓ£¬ÖÐÎç·¹¶¼Ã»³Ô£¬ÏÈÊÇstart service ²»Í¨¹ý£¬ÔÙÊÇApply security settings ²»Í¨¹ý£¨±¨Á˸ö1045µÄError£©£¬ºóÀ´ÖÕÓÚTMDµÄ¸ãµ½Ëüͨ¹ýÁË£¬½â¾ö°ì·¨ÈçÏ£º
¡¶µÚÒ»Öֳɹ¦£¬µÚ¶þºÍµÚÈýÖÖûÊÔ¡·£¬µÚ¶þºÍµÚÈýÊDZðÈËÌṩµÄ¡£
·½·¨Ò»£º
1, жÔØMySQL
2, ɾ³ýĿ¼ C:\Documents and Settings\Óû§Ãû ......
²é¿´×Ö·û¼¯ÉèÖÃ
mysql> show variables like 'collation_%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_ge ......
MySQLÐÔÄÜÓÅ»¯µÄ×î¼Ñ20+Ìõ¾Ñé
½ñÌ죬Êý¾Ý¿âµÄ²Ù×÷Ô½À´Ô½³ÉΪÕû¸öÓ¦ÓõÄÐÔÄÜÆ¿¾±ÁË£¬Õâµã¶ÔÓÚWebÓ¦ÓÃÓÈÆäÃ÷ÏÔ¡£¹ØÓÚÊý¾Ý¿âµÄÐÔÄÜ£¬Õâ²¢²»Ö»ÊÇDBA²ÅÐèÒªµ£ÐĵÄÊ£¬¶øÕâ¸üÊÇÎÒÃdzÌÐòÔ±ÐèҪȥ¹Ø×¢µÄÊÂÇé¡£µ±ÎÒÃÇÈ¥Éè¼ÆÊý¾Ý¿â±í½á¹¹£¬¶Ô²Ù×÷Êý¾Ý¿âʱ£¨ÓÈÆäÊDzé±íʱµÄSQLÓï¾ä£©£¬ÎÒÃǶ¼ÐèҪעÒâÊý¾Ý²Ù×÷µÄÐÔÄÜ¡£ÕâÀÎÒÃDz»» ......
MySqlѧϰ±Ê¼Ç MySql¸ÅÊö£ºMySqlÊÇÒ»¸öÖÖ¹ØÁªÊý¾Ý¿â¹ÜÀíϵͳ£¬Ëùν¹ØÁªÊý¾Ý¿â¾ÍÊǽ«Êý¾Ý±£´æÔÚ²»Í¬µÄ±íÖУ¬¶ø²»Êǽ«ËùÓÐÊý¾Ý·ÅÔÚÒ»¸ö´óµÄ²Ö¿âÖС£ÕâÑù¾ÍÔö¼ÓÁËËÙ¶ÈÓëÌá¸ßÁËÁé»îÐÔ¡£²¢ÇÒMySqlÈí¼þÊÇÒ»¸ö¿ª·ÅÔ´ÂëÈí¼þ¡£ ×¢Ò⣬MySqlËùÖ§³ÖµÄTimeStampµÄ×î´ó·¶Î§µÄÎÊÌ⣬ÔÚ32λ»úÆ÷ÉÏ£¬Ö§³ÖµÄÈ¡Öµ·¶Î§ÊÇÄê·Ý×îºÃ²»Òª³¬¹ý2030Äê ......
¿ÉÒÔÊÊÓÃÈκÎsql , ×Ô¶¯Ê¶±ð×Ö¶ÎÃû£¬ gzipѹËõ , ´øÊä³öbuffer , Ö§³Ö·Ö¿â·Ö±í
ÐèÒª¸¨Öú´úÂëºÍMakefie , ÏÂÃæÊÇÖ÷³ÌÐò´úÂ룬
/**
* mysqlÊý¾Ý±ídump³ÌÐò
* @author : cheng limin
* @date : 2010-1-18
*
* ʹÓÃÑùÀý:
*./dump_mysql -c ../conf/dump.conf
* -t xml
* -s ......