node | ip address | package |
Management & SQL node | 10.10.10.131 | MySQL-server-community-5.0.67-0.rhel5 MySQL-client-community-5.0.67-0.rhel5 MySQL-clustertools-community-5.0.67-0.rhel5 MySQL-clustermanagement-community-5.0.67-0.rhel5 |
data node #1 | 10.10.10.132 | MySQL-clusterstorage-community-5.0.67-0.rhel5 |
data node #2 | 10.10.10.133 | MySQL-clusterstorage-community-5.0.67-0.rhel5 |
架構示意圖如下,圖片引用自官方網站的資料,圖示內的 IP 請以上述表格所列的為主。
到官方下載需要的套件檔,請參考上方表格的內容。
MySQL-5.0.67 MySQL-6.3.20
rpm -ivh MySQL-client-community-5.0.67-0.rhel5.i386.rpm rpm -ivh MySQL-shared-compat-5.0.67-0.rhel5.i386.rpm rpm -ivh MySQL-devel-community-5.0.67-0.rhel5.i386.rpm rpm -ivh MySQL-server-community-5.0.67-0.rhel5.i386.rpm
以上套件是 SQL node 會用到的
rpm -ivh perl-HTML-Template-2.9-1.el5.rf.noarch.rpm rpm -ivh MySQL-clustermanagement-community-5.0.67-0.rhel5.i386.rpm rpm -ivh MySQL-clustertools-community-5.0.67-0.rhel5.i386.rpm
以上套件是 Management node 會用到,其中 perl-HTML-Template 不在官方網站的下載連結,請自行用 Google 搜尋。
新增設定檔:
/etc/my.cnf (SQL node 會用到)
# Options for mysqld process: [MYSQLD] ndbcluster # run NDB engine ndb-connectstring=10.10.10.131 # location of MGM node # Options for ndbd process: [MYSQL_CLUSTER] ndb-connectstring=10.10.10.131 # location of MGM node
/var/lib/mysql-cluster/config.ini (Management node 會用到)
# Options affecting ndbd processes on all data nodes: [NDBD DEFAULT] NoOfReplicas=2 # Number of replicas DataMemory=256M # How much memory to allocate for data storage IndexMemory=18M # How much memory to allocate for index storage # For DataMemory and IndexMemory, we have used the # default values. Since the "world" database takes up # only about 500KB, this should be more than enough for # this example Cluster setup. # TCP/IP options: [TCP DEFAULT] portnumber=2202 # This the default; however, you can use any # port that is free for all the hosts in cluster # Note: It is recommended beginning with MySQL 5.0 that # you do not specify the portnumber at all and simply allow # the default value to be used instead # Management process options: [NDB_MGMD] #hostname=mgm_sql-node.cluster # Hostname or IP address of MGM node hostname=10.10.10.131 # Hostname or IP address of MGM node datadir=/var/lib/mysql-cluster # Directory for MGM node logfiles # Options for data node "A": [NDBD] # (one [NDBD] section per data node) #hostname=data-node1.cluster # Hostname or IP address hostname=10.10.10.132 # Hostname or IP address datadir=/mysql-data # Directory for this data node's datafiles # Options for data node "B": [NDBD] #hostname=data-node2.cluster # Hostname or IP address hostname=10.10.10.133 # Hostname or IP address datadir=/mysql-data # Directory for this data node's datafiles # SQL node options: [MYSQLD] #hostname=mgm_sql-node.cluster hostname=10.10.10.131 # Hostname or IP address # (additional mysqld connections can be # specified for this node for various # purposes such as running ndb_restore)
MySQL Cluster 叢集安裝環境介紹
http://www.neo.com.tw/archives/869
MySQL 5.0 FAQ — MySQL Cluster
http://dev.mysql.com/doc/refman/5.0/...item-23-10-1-1
MySQL Cluster Overview
http://dev.mysql.com/doc/refman/5.0/...-overview.html
MySQL Cluster Multi-Computer How-To
http://dev.mysql.com/doc/refman/5.0/...-computer.html
MySQL Cluster Multi-Computer Configuration
http://dev.mysql.com/doc/refman/5.0/...ti-config.html
Safe Shutdown and Restart of MySQL Cluster
http://dev.mysql.com/doc/refman/5.0/...n-restart.html
MySQL叢集
http://twpug.net/docs/mysql-5.1/ndbcluster.html
MySQL Cluster學習筆記-1
http://www.ithome.com.tw/plog/index....015&blogId=257
MySQL Cluster學習筆記-2
http://www.ithome.com.tw/plog/index....176&blogId=257
MySQL Forums :: Cluster :: API not connecting to ndb_mgm
http://forums.mysql.com/read.php?25,182996,182996