【MySQL】MySQL NDB Cluster安装

MySQL集群是一个无共享的(share-nothing)、分布式节点架构的存储方案,目的是提供容错性和高性能。

MySQL NDB Cluster架构如图:


MySQL NDB Cluster架构按照节点类型分为三部分:
  • 管理节点:管理节点通过对配置文件conifg.ini的维护来对其他节点进行管理。该文件可以用来配置有多少副本需要维护、在数据节点上为数据和索引分配多少内存、数据节点的位置、数据节点上保存数据的磁盘的位置,SQL节点的位置信息等,管理节点只能有一个。
  • SQL节点:SQL节点可以理解为应用程序和数据节点的一个桥梁,应用程序不能直接访问数据节点,只能先访问SQL节点,然后SQL节点再去访问数据节点来返回数据,Cluster中可以有多个SQL节点,通过每个SQL节点查询到的数据都是一致的,一般来说,SQL节点越多,分配到每个SQL节点的负载就越小,系统的整体性能就越好;
  • 数据节点:数据节点用来存放数据,可有多个数据节点。

下面演示MySQL NDB Cluster的安装:

1、环境信息:
管理节点Mgmd:10.24.32.180
SQL节点Mysqld1:10.24.32.181
SQL节点Mysqld2:10.24.32.182
数据节点Ndbd1:10.24.32.183
数据节点Ndbd2:10.24.32.184
2、下载MySQL NDB Cluster软件;
[root@strong /]# ll /u01/
total 873104
-rw-r--r--. 1 root root 894037512 Mar  6 13:26 mysql-cluster-gpl-7.5.9-linux-glibc2.12-x86_64.tar.gz
[root@strong /]# 
3、安装SQL节点,在每个SQL节点都执行如下操作;
1)创建mysql用户和组,如果该用户和组不存在:
[root@strong ~]# grep mysql /etc/passwd
[root@strong ~]# grep mysql /etc/group
[root@strong ~]# groupadd mysql
[root@strong ~]# useradd -g mysql -s /bin/false mysql
[root@strong ~]# 
2)解压缩 mysql-cluster软件;
[root@strong local]# tar zxvf /u01/mysql-cluster-gpl-7.5.9-linux-glibc2.12-x86_64.tar.gz
[root@strong local]# ln -s mysql-cluster-gpl-7.5.9-linux-glibc2.12-x86_64/ mysql
[root@strong local]# 
3)设置数据库系统
[root@strong local]# cd mysql
[root@strong mysql]# ./bin/mysqld --initialize --user=mysql
2018-03-06T11:04:27.469235Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-06T11:04:28.202258Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-03-06T11:04:28.291271Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-03-06T11:04:28.360238Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 238f3d44-212e-11e8-a946-000c298da433.
2018-03-06T11:04:28.365955Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-03-06T11:04:28.371758Z 1 [Note] A temporary password is generated for root@localhost: 9gidWnDuEo_:
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值