Mysql Cluster Cluster Windows version

Source: Internet
Author: User
Tags node server

VM1:192.168.220.102 Management node (MGM)

vm2:192.168.220.103 Data Node (NDBD1), SQL node (SQL1)

VM3:192.168.220.104 Data Node (NDBD2), SQL node (SQL2)

MySQL cluster version: 7.4.6 (MSI Installer): http://dev.mysql.com/downloads/cluster/

Test tool: Navicate for MySQL

Three types of nodes:

Management node: Used to manage the cluster common node; daemon NDB_MGMD

Data node: The data used to hold the cluster; Daemon NDBD

SQL node: Used to connect data nodes; Daemon mysqld

Explain the management node is responsible for the management of data nodes and SQL node equivalent to the cluster of the brain, the data node is specifically responsible for the cluster storage data, SQL node is to give you a tool to connect.

The first step is to configure the management node and install the existing installation package.

To the root directory C:\Program files\mysql\mysql Cluster 7.4, add a configuration file configured as follows

[NDBD Default]
noofreplicas=2
maxnooftables=1024
maxnoofuniquehashindexes=1024
maxnooforderedindexes=1024
maxnoofattributes=10000

[NDB_MGMD]
Nodeid=1
hostname=192.168.220.102
Datadir=c:\program Files\mysql\mysql Cluster 7.4\data

[NDBD]
Nodeid=21
hostname=192.168.220.103
Datadir=c:\program Files\mysql\mysql Cluster 7.4\data

[NDBD]
Nodeid=22
hostname=192.168.220.104
Datadir=c:\program Files\mysql\mysql Cluster 7.4\data

[Mysqld]
nodeid=11
hostname=192.168.220.103

[Mysqld]
Nodeid=12
hostname=192.168.220.104

Please see the person must follow my above configuration to configure, do not change the folder name. Do not go to add the table of contents, because I read a lot of silly blog on the internet is optional to add directories to modify the directory name

Finally, the very clear directory of the structure of the chaos, resulting in a lot of mistakes in the back. It's already 1 o'clock in the morning, and now it's all because of the XJBG of these SB bloggers.

Don't say much nonsense after the above configuration, see below to define the meaning of the node. In short, there is a management node of 2 data Nodes 2 SQL nodes.

[NDBD]: Defines the data node of the cluster

[MYSQLD]: Defines the MySQL server node for the cluster

[MGM] or [NDB_MGMD]: Defines the Management Server node for the cluster

[NDB_MGMD] ID: node-unique identity

[NDBD] Noofreplicas: The global parameter can only be set in [NDBD DEFAULT], which defines the number of copies saved per table in the cluster. This parameter also specifies the size of the node group. A node group refers to a collection of nodes that hold the same information

[NDBD] DataDir: This parameter specifies the directory where trace files, log files, PID files, and error logs are stored

[Mysqld]basedir: Use the specified directory as the root directory

[Mysqld]datadir: Reads a database file using the specified directory

After the above configuration is basically completed a large part of the following to configure the data node and SQL node. In the general case the data node and the SQL node are paired up. It means that a MySQL server is made up of two nodes. Here's a look at how to configure a MySQL server under a cluster:

Install the downloaded MySQL Cluster 7.4 First, then locate the root directory C:\Program files\mysql\mysql Cluster 7.4 and add a configuration file named My.ini. Configuration content is as follows

[mysqld]character_set_server=utf8basedir= "C:\Program files\mysql\mysql Cluster 7.4" datadir= "C:\Program files\mysql \mysql Cluster 7.4\data "sql_mode=no_engine_substitution,strict_trans_tablesndbclusterndb-connectstring= 192.168.220.102explicit_defaults_for_timestamp=true[mysql_cluster]ndb-connectstring=192.168.220.102
To put it simply, it is actually the server that configures the SQL node and the Management Server for the data node. Here we are directly configured as we start to set the Management node server address on the line, remember
Basedir and DataDir do not fill the wrong, or the operation will appear a variety of wonderful mistakes, here I would like to spray I saw before those of the SB blog. It's not clear, not clear, even if there is no such configuration and only the following [Mysql_cluster] data node does not have a SQL node I'm doing it. Did you eat the SQL node? You know, copying and pasting all over the place. The chicken killed Lao Tzu. This place must be configured for both configuration sections    [mysqld].

The above is all the configuration, so simple to take care of the next we have to start one by one.
The starting order is 1: Management node 2: Data node 3:sql node


1:192.168.220.102 Open a command-line window, and then follow the command given below for a line of output.
CD "C:\Program files\mysql\mysql Cluster 7.4\bin"
    Ndb_mgmd.exe--config-file= "C:\Program files\mysql\mysql Cluster 7.4\config.ini"--configdir= "C:\Program files\mysql \mysql Cluster 7.4 "  
   After the above command executes successfully, CMD will automatically output    a MySQL Cluster Management Server mysql-5.6.24 ndb-7.4.6, and I won't be in trouble.
After executing the above command, remember not to close the current command window, and then open a new cmd command window. The one that turned off was sb. Don't ask me why, because I was hurt by those stupid blog posts.


2:192.168.220.103 or 192.168.220.104 open a command-line window and enter the following command.

CD "C:\Program files\mysql\mysql Cluster 7.3\bin"
Ndbd.exe--initial             

After successful execution, the CMD return information is almost the following,
2015-05-28 23:28:06 [NDBD] INFO--Angel connected to ' 192.168.2.73:1186 '

2015-05-28 23:28:06 [NDBD] INFO--Angel allocated nodeid:22


3:192.168.220.103 or 192.168.220.104 open a command-line window and enter the following command.
CD "C:\Program files\mysql\mysql Cluster 7.4\bin" Mysqld.exe--default-file= "C:\Program files\mysql\mysql Cluster 7.4\ My.ini "mysqld--installnet start MySQL
Remember the input of one line, the second line will be a little slower after the return. Do not turn off the cmd window. I started thinking that I was mistaken, and then shut the hell up. The result is naught from the beginning and not know where the wrong.

2015-05-28 23:29:02 0 [Note] mysqld.exe (mysqld 5.6.24-NDB-7.4.6-CLUSTER-GPL) St arting as Process 2868 ...


Service successfully installed.


The MySQL service is starting:
The MySQL service has started successfully.


Set both the 192.168.220.103 and the 192.168.220.104, and then switch to 192.168.220.102 to open a new command window. Do not close the Management Node Command window that was running before, or you are SB.
Then enter the following command in the newly opened command window:
Ndb_mgm.exe
Show
Remember that one line of input ndb_mgm.exe is a line show is also a line.
The result of the final successful return should look something like this:

Connected to Management Server at:localhost:1186
Cluster Configuration
---------------------
[NDBD (NDB)] 2 node (s)
Id=21 @192.168.220.103 (mysql-5.6.24 ndb-7.4.6, nodegroup:0, *)
Id=22 @192.168.220.104 (mysql-5.6.24 ndb-7.4.6, nodegroup:0)

[NDB_MGMD (MGM)] 1 node (s)
Id=1 @192.168.220.102 (mysql-5.6.24 ndb-7.4.6)

[Mysqld (API)] 2 node (s)
id=11 @192.168.220.103 (mysql-5.6.24 ndb-7.4.6)
Id=12 @192.168.220.104 (mysql-5.6.24 ndb-7.4.6)

The rest is the test, just download a navicat connection 192.168.220.104 and 192.168.220.103  These two SQL nodes, as usual to connect MySQL the same. And then you play.

Mom came home from work, and finished writing almost 2 o'clock.


I just want to say that the copy and paste of the trouble to see if it is right to paste the line? Toss me to death, you bastards!












Mysql Cluster Cluster Windows version

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.