1. Find out if you should use MySQL cluster first.
Reduce data Center node pressure and large amount of data processing, using the MySQL distribution, one or more application corresponding to a MySQL database. A few MySQL database common data to make shared data, such as shopping carts, user objects and so on, there are data nodes inside. Other data that is not shared is maintained in its own distributed MySQL database itself.
2. Cluster MySQL in the name concept. (as pictured above)
1 SQL node (mysqld on SQL node--): distributed database. including its own data and query center node data.
2 Data node-NDBD: Cluster shared data (in-memory).
3 Management Server (Management SERVER–NDB_MGMD): Cluster Management SQL Node,data node.
3. Configure
Mysql-max version, of course, now MySQL cluster system WINDONWS platform is not supported.
Install MySQL is not much to say, a lot of online, concise.
A:192.168.1.251–data node and management Server.
B:192.168.1.254–sql node.
Of course, you can also make a machine for 3 people 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 is more than enough for
- # This example Cluster setup. # TCP/IP options: [TCP DEFAULT]
- portnumber=2202 # this default; However, can use any
- # port, is, free, all, the hosts in cluster
- # Note:it is recommended beginning with MySQL 5.0
- # You don't 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 the 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 node ' s datafiles
- # SQL node options: [MySQLD] hostname=192.168.1.254
- #[mysqld] #这个相当于192.168.1.251