节点1:192.168.50.8
节点2:192.168.50.23
管理节点:192.168.50.38
1.配置管理节点#sudo vi /etc/mysql/my.cnf
[MYSQLD]
ndbcluster
ndb-connectstring = 192.168.50.38
[MYSQL_CLUSTER]
ndb-connectstring = 192.168.50.38
编辑/etc/mysql/ndb_mgmd.cnf如果没有就复制一份
#sudo cp /usr/share/doc/mysql-server-5.0/examples/ndb_mgmd.cnf /etc/mysql
#sudo vi /etc/mysql/ndb_mgmd.cnf
[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=10MB
IndexMemory=25MB
MaxNoOfTables=256
MaxNoOfOrderedIndexes=256
MaxNoOfUniqueHashIndexes=128
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
[NDB_MGMD]
Id=1
HostName=192.168.50.38
DataDir = /var/lib/mysql-cluster
[NDBD]
Id=2
HostName=192.168.50.8
DataDir= /var/lib/mysql-cluster
[NDBD]
Id=3
HostName=192.168.50.23
DataDir=/var/lib/mysql-cluster
[MYSQLD]
Id=4
HostName=192.168.50.38
[MYSQLD]
Id=5
HostName=192.168.50.8
[MYSQLD]
Id=6
HostName=192.168.50.23
[b]2.配置其他集群节点[/b]#sudo vi /etc/mysql/my.cnf
[MYSQLD]
ndbcluster
ndb-connectstring = 192.168.50.38
[MYSQL_CLUSTER]
ndb-connectstring = 192.168.50.38
3.编辑完成后1.管理节点
sudo /etc/init.d/mysql-ndb-mgm start
2.在其他集群节点
sudo /etc/init.d/mysql-ndb start
3.启动各个节点的mysql服务
验证:在管理节点运行
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.50.38:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.50.8 (Version: 5.0.75, Nodegroup: 0, Master)
id=3 @192.168.50.23 (Version: 5.0.75, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.50.38 (Version: 5.0.75)
[mysqld(API)] 3 node(s)
id=4 @192.168.50.38 (Version: 5.0.75)
id=5 @192.168.50.8 (Version: 5.0.75)
id=6 @192.168.50.23 (Version: 5.0.75)
表示配置成功
4.创建表
表的创建使用存储引擎必须是ndbcluster
eg:
create table users(
id int not null auto_increment,
username varchar(200) not null,
primary key(id)
)engine = ndbcluster default charset utf8;
要在其他节点看不到当前表所在的数据库,不需自行创建数据库后表才能同步;
分享到:
相关推荐
MySQL 8.0参考手册 Including MySQL NDB Cluster 8.0
Pro MySQL NDB Cluster 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Pro MySQL NDB Cluster 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在...
The book has been written for database administrators who are looking into deploying MySQL NDB Cluster or already have a cluster in production and want to increase their knowledge to be able to handle...
You will understand the advantages and disadvantages of the MySQL NDB Cluster solution, and when MySQL NDB Cluster is the right choice. Pro MySQL NDB Cluster walks you through the full lifecycle of ...
CentOS8部署Mysql NDB Cluster8+Mysql Router8方案及应用~~~~
MySQL NDB Cluster安装
详细描述MySQL NDB CLUSTER的安装部署应用!国际上唯一的专注书籍!
MySQL NDB Cluster is part of the MySQL family of products. There are few databases matching as many buzzwords as MySQL NDB Cluster: high availability, SQL, NoSQL, in-memory database, automatic failure...
MySQL NDB Cluster实践.pdf
MySQL Cluster 是专门用来做MySQL集群的程序,简单来讲它是一种技术,该技术能够在无共享的系统中部署内存中数据库的“Cluster”,通过无共享体系结构,系统能够使用各种廉价的硬件,并对所有硬件没有任何特殊的要求...
用于新手搭建学习,高手飘过。搭建过程中,注意各系统的环境不一致,可能会出现其他错误
MySQL Cluster(MySQL 集群) 测试环境: CentOS4.6 数据库版本: mysql-cluster-gpl-6.3.20
mysql_cluster NDB7.3新特性,解决冲突问题
MySQL Cluster 是 MySQL 适合于分布式计算环境的高实用、高冗余版本。它采用了NDB Cluster 存储引擎,允许在1个 Cluster 中运行多个MySQL服务器。 MySQL Cluster 是一种技术,该...2、mysql cluster 集群故障处理手册
通过学习mysql官方文档,在实验中形成的一份简明扼要的笔记性质文档,适合MySQL NDB集群感兴趣的同学参考。
MySQL Cluster NDB 7.3 and MySQL Cluster NDB 7.4 官方说明翻译
ndb是一种存储引擎,通常在mysql cluster中使用,MySQL Cluster 是一个基于NDB Cluster 存储引擎的完整的分布式数据库系统。 和Oracle Real Cluster Application 不太一样的是,MySQL Cluster 是一个Share Nothing ...
MySQL Cluster Windows 安装,最新官方文件翻译,适用于NDB7.4和7.3。
MySQL Cluster NDB 7.0 or MySQL Cluster 7.1 for supported platforms — these include RPMs that should work with most Linux distributions. MySQL Cluster users who build from source should be aware that,...