1. Check whether you should use a MySQL cluster.
Reduce the pressure on the data center nodes and process large data volumes. MySQL is distributed and one or more applications correspond to one MySQL database. Share data with the common data of several MySQL databases, such as shopping cart and user objects, in data nodes. Other non-shared data is maintained in the MySQL database.
2. Concept of name in cluster MySQL (for example)
1) SQL node (SQL node -- corresponding to MySQLd): Distributed Database. Including the data of itself and the data of the query center node.
2) Data node (Data node -- ndbd): the cluster shares Data (in memory ).
3) Management Server (Management Server-ndb_mgmd): Cluster Management SQL node and Data node.
3. Configuration
MySQL-max version, of course, is not supported on the MySQL cluster system windonws platform.
I won't talk much about installing MySQL. There are a lot of online information, which is concise and concise.
A: 192.168.1.20.- Data node and Management Server.
B: 192.168.1.254-SQL node.
Of course, you can also make one machine three at the same time.
A, B my. inf plus:
- MySQLD]
- ndbcluster # run NDB engine
- ndb-connectstring=192.168.1.251 # location of MGM node
- # Options for ndbd process: [MySQL_CLUSTER]
- ndb-connectstring=192.168.1.251 # location of MGM node
- A: /var/lib/MySQL-cluster/config.ini [NDBD DEFAULT]
- NoOfReplicas=1
- # Number of replicas DataMemory=80M
- # 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=192.168.1.251
- # 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=192.168.1.251
- # Hostname or IP address datadir=/usr/local/MySQL/data
- # Directory for this data nodes datafiles
- # SQL node options: [MySQLD] hostname=192.168.1.254
- #[MySQ