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

How to install cluster in mysql

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

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you about how to install cluster in mysql, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. Manage node installation

Rpm-vih / home/aa/MySQL-Cluster-gpl-management-7.1.15a-1.rhel5.i386.rpm

Rpm-vih / home/aa/MySQL-Cluster-gpl-tools-7.1.15a-1.rhel5.i386.rpm

Rpm-vih / home/aa/MySQL-Cluster-gpl-extra-7.1.15a-1.rhel5.i386.rpm

two。 Installed on both sql nodes (both are installed)

Rpm-vih / home/aa/MySQL-Cluster-gpl-server-7.1.15a-1.rhel5.i386.rpm

Rpm-vih / home/aa/MySQL-Cluster-gpl-client-7.1.15a-1.rhel5.i386.rpm

3. Installation of two data nodes

Rpm-vih / home/aa/MySQL-Cluster-gpl-storage-7.1.15a-1.rhel5.i386.rpm

4. Manage node configuration

Mkdir / var/lib/-cluster

Cd / var/lib/mysql-cluster

Vim / var/lib/mysql-cluster/config.ini

[ndbd default]

NoOfReplicas=2

DataMemory=80M

IndexMemory=18M

[tcp default]

[ndb_mgmd]

Hostname=192.168.1.103 # Management Node address

Datadir=/var/lib/mysql-cluster

[ndbd]

Hostname=192.168.1.100 # data Node ip

Datadir=/var/lib/mysql-cluster/data # this data directory was created manually on the data node by me

[ndbd]

Hostname=192.168.1.61 # second data node ip

Datadir=/var/lib/mysql-cluster/data

[mysqld]

Hostname=192.168.1.101 # sql Node ip

[mysqld]

Hostname=192.168.1.104 # second sql node ip

5. Data node configuration (configured on both nodes)

Vim / etc/my.cnf

[mysqld]

Ndbcluster

Ndb-connectstring=192.168.1.103 # Management Node ip

[mysql_cluster]

Ndb-connectstring=192.168.1.103 # Management Node ip

6.sql node configuration (on both nodes)

Vim / etc/my.cnf

[mysqld]

Ndbcluster

Ndb-connectstring=192.168.1.103 # Management Node ip

Port=3306

[mysql_cluster]

Ndb-connectstring=192.168.1.103 # Management Node ip

7. Start mysql cluster

First start the management node, then start the data node, and finally start the sql node

Start the management node:

Ndb_mgmd-f / var/lib/mysql-cluster/config.ini

Start the data node:

Ndbd

Start the sql node:

/ usr/bin/mysqld_safe-user=mysql &

The above is how to install cluster in mysql. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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