mysql集群安装指南,MySQL集群在IBM服务器上配置安装详解
小心: 即使在db1上创制贰个数据库是不能够协作到db2上去的,两侧需求有生机勃勃致名字的库名,库中的数据才干协同过去
始创设造文件config.ini
# vi /main/mysql/etc/config.ini
[ndb_mgmd default]
datadir = /main/mysql/data
[[email protected] MySQL-max-5.0.24-linux-i686]# cd bin/ndb_mgm* /usr/bin
NDBD2:192.168.100.213
2,分别在DB1和DB2上运行数量节点
1, 解压MySQL-max-5.0.24-linux-i686.tar.gz包,拷贝包里bin目录下的ndb_mgm和ndb_mgmd两文本到/usr/bin/目录中看一下是否享有可进行权限)。
3:启动SQL (SQL1和SQL2节点)
[[email protected] software]#groupadd MySQL [[email protected] software]#useradd –g MySQL MySQL [[email protected] software]# tar -zxf MySQL-max-5.0.24-linux-i686.tar.gz [[email protected] software]#mv MySQL-max-5.0.24-linux-i686 MySQL [[email protected] software]#mv MySQL /usr/local/MySQL
创立构造文件my.cnf
# vi /etc/my.cnf
[mysqld]
basedir = /main/mysql
datadir = /main/mysql/data
ndbcluster
ndb-connectstring = 192.168.100.211
[mysql_cluster]
ndb-connectstring = 192.168.100.211
二,在DB1和DB2上布署MySQL配置进程肖似)
去除系统自带mysql:
# rpm -qa | grep mysql
# rpm -e --allmatches --nodeps mysql-libs-5.1.71-1.el6.x86_64
四,MySQL cluster的启动
--运转拘留节点
[root@localhost config]# /cluster/bin/ndb_mgmd -f
/cluster_data/config/config.ini
MySQL Cluster Management Server mysql-5.6.29 ndb-7.4.11
Mkdir /usr/local/MySQL-cluster Cd /usr/local/MySQL-cluster Vi config.ini
系统环境:CentOS 6.5 mini(64bit)
软件版本:mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64.tar.gz
为了飞快搭建所需意况,作者接受了生龙活虎台IBM服务器安装了Vmware esx 4.0,用vm的ovf模板布置了3台centos,后生可畏台作为管理M丙胺博莱霉素),节点两台作为SQL节点和多少节点。Computer名和IP地址如下:
新建mysql客商及顾客组
# groupadd mysql
# useradd -g mysql -s /usr/sbin/nologin mysql
# chown -R mysql:mysql /main/mysql
[[email protected] MySQL]# more ndb_pid4968_error.log Current byte-offset of file-pointer is: 568 Time: Wednesday 5 May 2010 - 14:17:25 Status: Permanent error, external action needed Message: Invalid configuration received from Management Server (Configuration error) Error: 2350 Error data: Could not connect to ndb_mgmd Error object: Program: bin/ndbd Pid: 4968 Trace: <no tracefile> Version: Version 5.0.24 ***EOM***
#./ndb_mgm -e shutdown
[[email protected] MySQL]# bin/ndbd –initial
条件认证
MySQL> use test Database changed MySQL> show tables; +----------------+ | Tables_in_test | +----------------+ | mingxing | +----------------+ 1 row in set (0.01 sec) MySQL> select * from mingxing; +------+ | name | +------+ | jay | | cyl | | ldh | +------+ 3 rows in set (0.00 sec)
[mysqld]
NodeId = 81
HostName = 192.168.100.214
[mysqld]
NodeId = 82
HostName = 192.168.100.215
[MySQLD] ndbcluster ndb-connectstring=192.168.20.203 [MySQL_CLUSTER] ndb-connectstring=192.168.20.203
二、节点配置
1.配置 MGM (MGM 节点)
除去自带的my.cnf文件
一定要刨除自带的/etc/my.cnf,若无就无须删除
# rm -rf /etc/my.cnf
[[email protected] MySQL]# bin/ndbd --initial Unable to connect with connect string: nodeid=0,192.168.20.203:1186 Retrying every 5 seconds. Attempts left: 12 11 10 9 8 7 6 5 4 3 2 1, failed. error=2350 2010-05-05 14:21:21 [ndbd] INFO -- Error handler restarting system 2010-05-05 14:21:21 [ndbd] INFO -- Error handler shutdown completed - exiting sphase=0 exit=-1
三、运行节点
开发银行需按如下顺序实行:M罗红霉素 > NDBD > SQL
看带下划线处,不可能连接收管理节点,笔者的管住节点运营是ok的呀,倏然一下明了了,防火墙是开着的系统暗中同意是开启的),关掉防火墙和SELinux,重新ndbd –initial,运维成功
--重启SQL节点
[root@localhost mysql-cluster-gpl-7.4.11]# /cluster/bin/mysqladmin
-usystem -p shutdown
[root@localhost mysql-cluster-gpl-7.4.11]# /cluster/bin/mysqld_safe
--defaults-file=/etc/my.cnf
1,[[email protected] MySQL-cluster]# ndb_mgmd -f ./config.ini
DB1 192.168.20.201
关闭防火墙
# service iptables stop
[[email protected] ~]# ndb_mgm -- NDB Cluster -- Management Client -- ndb_mgm> show Connected to Management Server at: localhost:1186 Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=2 @192.168.20.201 (Version: 5.0.24, Nodegroup: 0, Master) id=3 @192.168.20.202 (Version: 5.0.24, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.20.203 (Version: 5.0.24) [MySQLd(API)] 2 node(s) id=4 @192.168.20.201 (Version: 5.0.24) id=5 @192.168.20.202 (Version: 5.0.24)
NDBD1:192.168.100.212
MGM 192.168.20.203
[ndbd default]
NoOfReplicas = 2
DataMemory = 80M
IndexMemory = 18M
datadir = /main/mysql/data
[[email protected] MySQL]# service MySQLd stop [[email protected] MySQL]# vi /etc/my.cnf
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Connected to Management Server at : localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 ( not connected, accepting connect from 192.168.100.212)
id=12 ( not connected, accepting connect from 192.168.100.213)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.100.211 (mysql-5.6.21 ndb-7.3.7)
[mysqld(API)] 2 node(s)
id=81 ( not connected, accepting connect from 192.168.100.214)
id=82 ( not connected, accepting connect from 192.168.100.215)
|
增添如下内容:
# service mysqld start
2, 拷贝MySQL配置文件到/etc/下,初步化数据库,设置目录权限,运维MySQL
翻开集群状态
# ndb_mgm -e show
封存退出
IP地址:
MGM:192.168.100.211
看青蓝标识的字段,能够阅览管理节点,sql节点和数量节点,还或许有一个接连端口。
[ndb_mgmd]
NodeId = 1
HostName = 192.168.100.211
三,布署管理节点
解压缩软件
上传软件到/main目录
# cd /main
# tar zxvf mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64.tar.gz
# mv mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64 mysql
[[email protected] software]# cd /usr/local/MySQL/ [[email protected] MySQL]# cp support-files/my-medium.cnf /etc/my.cnf [[email protected] MySQL]# scripts/MySQL_install_db --user=MySQL [[email protected] MySQL]#chown -R root . [[email protected] MySQL]#chown -R MySQL data [[email protected] MySQL]#chgrp -R MySQL . [[email protected] MySQL]# bin/MySQLd_safe --user=MySQL &
2:启动NDBD(NDBD1和NDBD2节点)
# ndbd --initial
编排推荐】
在拘系节点切换来 /usr/local/mysql/bin目录
4, 甘休MySQL服务,改善配置文件
SQL1:192.168.100.214
SQL2:192.168.100.215
MySQL-max-5.0.24-linux-i686.tar.gz
2.安顿数据节点(NDBD1和NDBD2节点)
创制布局文件my.cnf
# vi /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring = 192.168.100.211
[mysql_cluster]
ndb-connectstring = 192.168.100.211
3.配置SQL节点(SQL1和SQL2节点)
拷贝文件
# cp -p /main/mysql/support-files/mysql.server /etc/init.d/mysqld
一.环境: IBM x3560 Vmware esx 4.0 centos 5.3 32bit MySQL-max-5.0.24-linux-i686.tar....
后生可畏、Cluster安装(八个节点)
安装相关正视包
# yum -y install perl libaio ntpdate
MySQL> use test Database changed MySQL> create table mingxing(name char(3))engine=ndb; Query OK, 0 rows affected (0.57 sec) MySQL> insert into mingxing value('jay'),('cyl'),('ldh'); Query OK, 3 rows affected (0.04 sec) Records: 3 Duplicates: 0 Warnings: 0
新建配置文件贮存目录
# mkdir /main/mysql/etc
# chown mysql:mysql /main/mysql/etc
本文由美高梅4858官方网站发布于美高梅4858mgm,转载请注明出处:mysql集群安装指南,MySQL集群在IBM服务器上配置安装详解
关键词: