Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary and Analysis of Cluster Construction in windows CVM

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you a summary and analysis of the problems of building a cluster for windows CVM. The knowledge mentioned here is slightly different from books. It is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to readers.

Server version winsever2016 64-bit

Mysql-cluster-gpl-7.6.7-winx64. Zip

Decompress mysql-cluster-gpl-7.6.7-winx64.zip, I stored it on D disk and renamed the folder, so I changed it to literal translation cluster, mysqlCluster.

Note: the unzipped file directory does not contain the data,db folder and file config.ini&my.ini.

I created it myself later.

Let's start with the configuration file:

Config.ini is used to configure the management node, data node, SQL node. The following text is pasted directly to facilitate replication:

[ndbd default]

NoOfReplicas=2

MaxNoOfTables=1024

MaxNoOfUniqueHashIndexes=1024

MaxNoOfOrderedIndexes=1024

MaxNoOfAttributes=10000

[ndb_mgmd]

NodeId=1

HostName=192.168.101.31

DataDir=D:\ mysqlCluster\ data

[ndbd]

NodeId=21

HostName=192.168.101.31

DataDir=D:\ mysqlCluster\ data

[ndbd]

NodeId=22

HostName=192.168.101.30

DataDir=D:\ mysqlCluster\ data

[mysqld]

NodeId=11

HostName=192.168.101.31

[mysqld]

NodeId=12

HostName=192.168.101.30

My.ini Mysql profile

[mysqld]

Character_set_server=utf8

Basedir= "D:\ mysqlCluster"

Datadir= "D:\ mysqlCluster\ db"

Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Ndbcluster

Ndb-connectstring=192.168.101.31

Explicit_defaults_for_timestamp=true

Event_scheduler=on

[mysql_cluster]

Ndb-connectstring=192.168.101.31

Because there are scheduled execution events in the database I designed, the following line is specially written

Event_scheduler=on

Briefly, I have only two machines, 192.168.101.31 and 192.168.101.30.

Among them, 192.168.101.31 acts as both a management node and a data node.

First deal with the 192.168.101.31 server

Store the config.ini and my.ini files in its D:\ mysqlCluster directory.

Create data and db folders

Secondly, deal with 192.168.101.30 server

Just store the my.ini file in its D:\ mysqlCluster directory.

Create data and db folders

Once the files and directories are ready, the cluster will be started.

The order is the management node → data node → SQL node.

In 192.168.101.31, the server opened cmd as an administrator and jumped to the cluster directory

Microsoft Windows [version 10.0.14393]

(C) 2016 Microsoft Corporation. All rights reserved.

C:\ Windows\ system32 > cd..

C:\ Windows > cd.

C:\ > D:

D:\ > cd mysqlCluster\ bin

Execution

Ndb_mgmd.exe-- config-file= "D:\ mysqlCluster\ config.ini"-- configdir= "D:\ mysqlCluster"

It's easy to start the data node. Open a cmd window and jump to the directory.

Microsoft Windows [version 10.0.14393]

(C) 2016 Microsoft Corporation. All rights reserved.

C:\ Windows\ system32 > cd..

C:\ Windows > cd.

C:\ > D:

D:\ > cd mysqlCluster\ bin

Execution

Ndbd.exe-initial

You need to do more to start the SQL node, and there are many possible errors.

Still jump to the directory D:\ > cd mysqlCluster\ bin, and then perform initialization

Mysqld-- initialize-- datadir=D:\ mysqlCluster\ db

An error will be reported if you do not specify datadir.

After initializing the Mysql database, register the Mysql service.

Mysqld-- install Mysql my service name here is Mysql.

Net start Mysql starts the service, and Mysql is the name registered on the previous line.

It's easy to turn on the SQL node, jump to the D:\ > cd mysqlCluster\ bin directory and execute mysqld.

Next, deal with the 192.168.101.30 server, which is not an administrative node, so do a little less.

Just follow the startup mode of the data node and SQL node mentioned above.

* * many people may turn off the server's arson wall directly. I have open ports 3306 and 1186.

The test of each node is as follows:

******

The password of the root account is randomly generated when the mysql database is first used after version 5.7, so we may need to do something more.

First open a cmd window and execute mysqld-skip-grant-tables to enter safe mode

Open a cmd window again and enter mysql directly to skip permission verification to connect to the database.

Update mysql.user set authentication_string=password ('root') where user='root'

Flush privileges

Quit

Close all command prompt windows and use the command (taskkill / f / im mysqld.exe;) to end the process or end the mysqld.exe process in the task manager. Restart the MySQL service, then use your root account and new password.

For example, there was this mistake:

1045-Access denied for user'root'@'192.168.101.30' (using password: yes)

The reason is that there is no open access.

The steps are as follows:

1. D:/mysqlcluster/bin/ > mysql-h localhost-u root-p

Log in to the mysql server after entering the password

2. Mysql > grant all privileges on *. * to 'root'@'%' with grant option

Permissions for any host to access data

3. Mysql > flush privileges

The modification takes effect.

4. Mysql > quit

Exit the mysql server

For the summary and analysis of the above questions on building clusters for windows CVM, if you have more information to learn, you can continue to pay attention to the innovation of our industry. If you need professional solutions, you can contact the pre-sales and after-sales on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report